Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bitfield ¶
type Bitfield []byte
type Client ¶
type Client struct { Conn net.Conn Choked bool Bitfield Bitfield // contains filtered or unexported fields }
func NewClient ¶
func NewClient( peer peer.Peer, peerID handshake.PeerID, infoHash handshake.Hash, ) (*Client, error)
NewClient returns a new client This also executes the handshake
func (*Client) SendInterested ¶
SendInterested send a interested message
func (*Client) SendNotInterested ¶
SendNotInterested sends a not interested messaged
func (*Client) SendRequest ¶
SendRequest sends a new request with the expected index, begin and length
func (*Client) SendUnchoke ¶
SendUnchoke send a new unchoke message
type Torrent ¶
type Torrent struct { Peers []peer.Peer PeerID handshake.PeerID InfoHash handshake.Hash PieceHashes []handshake.Hash PieceLength int Length int Name string }
Torrent is the full representation for a torrent with peers and pieces
func TorrentFromTorrentFile ¶
TorrentFromTorrrentFile returns a torrent from a torrent file
Click to show internal directories.
Click to hide internal directories.