peerwriter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2019 License: MIT Imports: 9 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) *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 {
	Piece  io.ReaderAt
	Index  uint32
	Begin  uint32
	Length uint32
}

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