Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBlockDuplicate = errors.New("received duplicate block") ErrBlockNotRequested = errors.New("received not requested block") )
Functions ¶
This section is empty.
Types ¶
type PieceDownloader ¶
type PieceDownloader struct { Piece *piece.Piece 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, 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) error
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.