piecedownloader

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: MIT Imports: 3 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
	Buffer []byte
	// 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, buf []byte) *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