Documentation ¶
Index ¶
- type Message
- type Peer
- func (p *Peer) Close()
- func (p *Peer) DownloadSpeed() uint
- func (p *Peer) ResetSnubTimer()
- func (p *Peer) Run(messages chan Message, pieces chan interface{}, snubbed, disconnect chan *Peer)
- func (p *Peer) StartPEX(initialPeers map[*Peer]struct{})
- func (p *Peer) StopSnubTimer()
- func (p *Peer) UploadSpeed() uint
- type PieceMessage
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Peer ¶
type Peer struct { *peerconn.Conn ConnectedAt time.Time Source Source Bitfield *bitfield.Bitfield AllowedFast pieceset.PieceSet ID [20]byte ExtensionsEnabled bool FastEnabled bool EncryptionCipher mse.CryptoMethod ClientInterested bool ClientChoking bool PeerInterested bool PeerChoking bool OptimisticUnchoked bool // Snubbed means peer is sending pieces too slow. Snubbed bool Downloading bool // Messages received while we don't have info yet are saved here. Messages []interface{} ExtensionHandshake *peerprotocol.ExtensionHandshakeMessage PEX *pex // contains filtered or unexported fields }
func (*Peer) DownloadSpeed ¶ added in v0.3.0
func (*Peer) ResetSnubTimer ¶
func (p *Peer) ResetSnubTimer()
func (*Peer) StopSnubTimer ¶
func (p *Peer) StopSnubTimer()
func (*Peer) UploadSpeed ¶ added in v0.3.0
type PieceMessage ¶
type PieceMessage struct { *Peer Piece peerreader.Piece }
Click to show internal directories.
Click to hide internal directories.