Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReset = errors.New("stream reset")
ErrReset is returned when reading or writing on a reset stream.
View Source
var NoOpHandler = func(s Stream) { s.Reset() }
NoOpHandler do nothing. Resets streams as soon as they are opened.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { // Close closes the stream muxer and the the underlying net.Conn. io.Closer // IsClosed returns whether a connection is fully closed, so it can // be garbage collected. IsClosed() bool // OpenStream creates a new stream. OpenStream() (Stream, error) // AcceptStream accepts a stream opened by the other side. AcceptStream() (Stream, error) }
Conn is a stream-multiplexing connection to a remote peer.
type Stream ¶
type Stream interface { io.Reader io.Writer // Close closes the stream for writing. Reading will still work (that // is, the remote side can still write). io.Closer // Reset closes both ends of the stream. Use this to tell the remote // side to hang up and go away. Reset() error SetDeadline(time.Time) error SetReadDeadline(time.Time) error SetWriteDeadline(time.Time) error }
Stream is a bidirectional io pipe within a connection.
Click to show internal directories.
Click to hide internal directories.