Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoOpHandler = func(s Stream) { s.Close() }
NoOpHandler do nothing. close streams as soon as they are opened.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface {
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)
// Serve starts a loop, accepting incoming requests and calling
// `StreamHandler with them. (Use _instead of_ accept. not both.)
Serve(StreamHandler)
}
Conn is a stream-multiplexing connection to a remote peer.
type StreamHandler ¶
type StreamHandler func(Stream)
StreamHandler is a function that handles streams (usually those opened by the remote side)
Directories
¶
| Path | Synopsis |
|---|---|
|
package multistream implements a peerstream transport using go-multistream to select the underlying stream muxer
|
package multistream implements a peerstream transport using go-multistream to select the underlying stream muxer |
Click to show internal directories.
Click to hide internal directories.
