Documentation
¶
Index ¶
- type Message
- type Peer
- func (p *Peer) CancelPiece(index, begin, length uint32)
- func (p *Peer) Choke()
- func (p *Peer) Choking() bool
- func (p *Peer) Close()
- func (p *Peer) Done() chan struct{}
- func (p *Peer) DownloadSpeed() uint
- func (p *Peer) Interested() bool
- func (p *Peer) MetadataSize() uint32
- func (p *Peer) Optimistic() bool
- func (p *Peer) RequestMetadataPiece(index uint32)
- func (p *Peer) RequestPiece(index, begin, length uint32)
- func (p *Peer) ResetSnubTimer()
- func (p *Peer) Run(messages chan Message, pieces chan interface{}, snubbed, disconnect chan *Peer)
- func (p *Peer) SetOptimistic(value bool)
- func (p *Peer) StartPEX(initialPeers map[*Peer]struct{})
- func (p *Peer) StopSnubTimer()
- func (p *Peer) Unchoke()
- 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) CancelPiece ¶ added in v0.5.0
func (*Peer) DownloadSpeed ¶ added in v0.3.0
func (*Peer) Interested ¶ added in v0.4.9
func (*Peer) MetadataSize ¶ added in v0.5.0
func (*Peer) Optimistic ¶ added in v0.4.9
func (*Peer) RequestMetadataPiece ¶ added in v0.5.0
func (*Peer) RequestPiece ¶ added in v0.5.0
func (*Peer) ResetSnubTimer ¶
func (p *Peer) ResetSnubTimer()
func (*Peer) SetOptimistic ¶ added in v0.4.9
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.