peerreader

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PiecePool = sync.Pool{
	New: func() interface{} {
		return make([]byte, piece.BlockSize)
	},
}

Functions

This section is empty.

Types

type PeerReader

type PeerReader struct {
	// contains filtered or unexported fields
}

func New

func New(conn net.Conn, l logger.Logger, pieceTimeout time.Duration, bufferSize int, fastExtension, extensionProtocol bool) *PeerReader

func (*PeerReader) Done

func (p *PeerReader) Done() chan struct{}

func (*PeerReader) Messages

func (p *PeerReader) Messages() <-chan interface{}

func (*PeerReader) Run

func (p *PeerReader) Run()

func (*PeerReader) Stop

func (p *PeerReader) Stop()

type Piece

type Piece struct {
	peerprotocol.PieceMessage
	Data []byte
}

Jump to

Keyboard shortcuts

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