Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyConfig ¶
VerifyConfig is used to verify the sanity of configuration
Types ¶
type Config ¶
type Config struct { // KeepAliveInterval is how often to send a NOP command to the remote KeepAliveInterval time.Duration // KeepAliveTimeout is how long the session // will be closed if no data has arrived KeepAliveTimeout time.Duration // MaxFrameSize is used to control the maximum // frame size to sent to the remote MaxFrameSize int // MaxReceiveBuffer is used to control the maximum // number of data in the buffer pool MaxReceiveBuffer int }
Config is used to tune the Smux session
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig is used to return a default configuration
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
Frame defines a packet from or to be multiplexed into a single connection
func (*Frame) MarshalBinary ¶
MarshalBinary a frame to transmit VERSION(1B) | CMD(1B) | LENGTH(2B) | STREAMID(4B) | DATA |
func (*Frame) UnmarshalBinary ¶
UnmarshalBinary a byte slice into a frame
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session defines a multiplexed connection for streams
func Client ¶
func Client(conn io.ReadWriteCloser, config *Config) (*Session, error)
Client is used to initialize a new client-side connection.
func Server ¶
func Server(conn io.ReadWriteCloser, config *Config) (*Session, error)
Server is used to initialize a new server-side connection.
func (*Session) AcceptStream ¶
AcceptStream is used to block until the next available stream is ready to be accepted.
func (*Session) NumStreams ¶
NumStreams returns the number of currently open streams
func (*Session) OpenStream ¶
OpenStream is used to create a new stream