Documentation ¶
Index ¶
- type BufferedStream
- func (s *BufferedStream) Close() error
- func (s *BufferedStream) Read(bufferPool chan []byte) ([]byte, int, error)
- func (s *BufferedStream) Reset() error
- func (s *BufferedStream) SetDeadline(t time.Time) error
- func (s *BufferedStream) SetReadDeadline(t time.Time) error
- func (s *BufferedStream) SetWriteDeadline(t time.Time) error
- func (s *BufferedStream) Start(ctx context.Context) bool
- func (s *BufferedStream) Stop()
- func (s *BufferedStream) Wait()
- func (s *BufferedStream) Write(msg []byte) (int, error)
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) Stop ¶
func (s *BufferedStream) Stop()
Stop is called when the BufferedStream stops
Click to show internal directories.
Click to hide internal directories.