Documentation ¶
Overview ¶
Package cmux provides multiplexing over net.Conns using smux and adhering to standard net package interfaces.
Index ¶
- Variables
- func Listen(opts *ListenOpts) net.Listener
- func NewSmuxProtocol(config *smux.Config) *smuxProtocol
- func RunAllProtocolTests(proto Protocol, t *testing.T)
- func RunCloseTest(proto Protocol, t *testing.T)
- func RunErrorShapeTest(proto Protocol, t *testing.T)
- func RunRoundTripTest(proto Protocol, t *testing.T)
- type DialFN
- type DialerOpts
- type ErrorMapperFn
- type ListenOpts
- type Protocol
- type Session
Constants ¶
This section is empty.
Variables ¶
var (
ErrClosed = errors.New("listener closed")
)
var (
ErrTimeout = &timeoutError{}
)
Functions ¶
func Listen ¶
func Listen(opts *ListenOpts) net.Listener
Listen creates a net.Listener that multiplexes connections over a connection obtained from the underlying opts.Listener.
func NewSmuxProtocol ¶
NewSmuxProtocol creates a new smux based Protocol using the smux configuration givien. If config is nil, the default smux configuration is used.
func RunAllProtocolTests ¶
func RunCloseTest ¶
func RunErrorShapeTest ¶
func RunRoundTripTest ¶
Types ¶
type DialFN ¶
DialFN is a function that dials like net.DialContext.
func Dialer ¶
func Dialer(opts *DialerOpts) DialFN
Dialer creates a DialFN that returns connections that multiplex themselves over a single connection obtained from the underlying opts.Dial function. It will continue to use that single connection until and unless it encounters an error creating a new multiplexed stream, at which point it will dial again.