peerwriter

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 8 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 (m Piece) ID() peerprotocol.MessageID

func (Piece) MarshalBinary

func (m Piece) MarshalBinary() ([]byte, error)

Jump to

Keyboard shortcuts

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