transport

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2022 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedStream

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

BufferedStream is a bidirectional I/O pipe that supports sending/receiving arbitrarily long messages

func NewBufferedStream

func NewBufferedStream(rawStream p2pcmn.ReadWriteCloser, onError p2pcmn.ErrorHandler) *BufferedStream

func (*BufferedStream) Close

func (s *BufferedStream) Close() error

Close closes the stream for writing. Reading will still work (that is, the remote side can still write).

func (*BufferedStream) Read

func (s *BufferedStream) Read(bufferPool chan []byte) ([]byte, int, error)

TODO: Read implements the io.Reader

func (*BufferedStream) Reset

func (s *BufferedStream) Reset() error

Reset closes both ends of the stream. Use this to tell the remote side to hang up and go away.

func (*BufferedStream) SetDeadline

func (s *BufferedStream) SetDeadline(t time.Time) error

SetDeadline is a stub

func (*BufferedStream) SetReadDeadline

func (s *BufferedStream) SetReadDeadline(t time.Time) error

SetReadDeadline is a stub

func (*BufferedStream) SetWriteDeadline

func (s *BufferedStream) SetWriteDeadline(t time.Time) error

SetWriteDeadline is a stub

func (*BufferedStream) Start

func (s *BufferedStream) Start(ctx context.Context) bool

func (*BufferedStream) Stop

func (s *BufferedStream) Stop()

Stop is called when the BufferedStream stops

func (*BufferedStream) Wait

func (s *BufferedStream) Wait()

Wait suspends the caller goroutine

func (*BufferedStream) Write

func (s *BufferedStream) Write(msg []byte) (int, error)

Write implements the io.Writer, and supports writting arbitrarily long messages

Directories

Path Synopsis
flowrate
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.

Jump to

Keyboard shortcuts

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