piecedownloader

package
v0.4.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2019 License: MIT Imports: 4 Imported by: 0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL