peerwriter

package
v0.17.10 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockUploaded

type BlockUploaded struct {
	Length uint32
}

type PeerWriter

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

func New

func New(conn net.Conn, l logger.Logger, maxQueuedRequests int, fastEnabled bool, b *ratelimit.Bucket) *PeerWriter

func (*PeerWriter) CancelRequest

func (p *PeerWriter) CancelRequest(msg peerprotocol.CancelMessage)

func (*PeerWriter) Done

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

func (*PeerWriter) Messages

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

func (*PeerWriter) Run

func (p *PeerWriter) Run()

func (*PeerWriter) SendMessage

func (p *PeerWriter) SendMessage(msg peerprotocol.Message)

func (*PeerWriter) SendPiece

func (p *PeerWriter) SendPiece(msg peerprotocol.RequestMessage, pi io.ReaderAt)

func (*PeerWriter) Stop

func (p *PeerWriter) Stop()

type Piece

type Piece struct {
	Data io.ReaderAt
	peerprotocol.RequestMessage
}

func (Piece) ID

func (p Piece) ID() peerprotocol.MessageID

func (Piece) Read added in v0.4.5

func (p Piece) Read(b []byte) (int, error)

Jump to

Keyboard shortcuts

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