Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PieceDownloader ¶
type PieceDownloader struct { Piece *piece.Piece Peer *peer.Peer AllowedFast bool Buffer bufferpool.Buffer // contains filtered or unexported fields }
PieceDownloader downloads all blocks of a piece from a peer.
func New ¶
func New(pi *piece.Piece, pe *peer.Peer, allowedFast bool, buf bufferpool.Buffer) *PieceDownloader
func (*PieceDownloader) CancelPending ¶
func (d *PieceDownloader) CancelPending()
func (*PieceDownloader) Choked ¶
func (d *PieceDownloader) Choked()
func (*PieceDownloader) Done ¶
func (d *PieceDownloader) Done() bool
func (*PieceDownloader) GotBlock ¶
func (d *PieceDownloader) GotBlock(block piece.Block, data []byte)
func (*PieceDownloader) Rejected ¶
func (d *PieceDownloader) Rejected(block piece.Block)
func (*PieceDownloader) RequestBlocks ¶
func (d *PieceDownloader) RequestBlocks(queueLength int)
Click to show internal directories.
Click to hide internal directories.