Documentation ¶
Index ¶
- func VerifyConfig(config *Config) error
- type Config
- type Frame
- type Session
- type Stream
- func (s *Stream) Close() error
- func (s *Stream) ID() uint32
- func (s *Stream) LocalAddr() net.Addr
- func (s *Stream) Read(b []byte) (n int, err error)
- func (s *Stream) RemoteAddr() net.Addr
- func (s *Stream) SetDeadline(t time.Time) error
- func (s *Stream) SetReadDeadline(t time.Time) error
- func (s *Stream) SetWriteDeadline(t time.Time) error
- func (s *Stream) Write(b []byte) (int, error)
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 // ReadTimeout defines the global timeout for writing a single frame to a // conn. ReadTimeout time.Duration // WriteTimeout defines the default amount of time to wait before giving up // on a write. This same value is used as a global timeout for writing a // single frame to the connection. WriteTimeout time.Duration }
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
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session defines a multiplexed connection for streams
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
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream implements net.Conn
func (*Stream) RemoteAddr ¶
RemoteAddr satisfies net.Conn interface
func (*Stream) SetDeadline ¶
SetDeadline sets both read and write deadlines as defined by net.Conn.SetDeadline. A zero time value disables the deadlines.
func (*Stream) SetReadDeadline ¶
SetReadDeadline sets the read deadline as defined by net.Conn.SetReadDeadline. A zero time value disables the deadline.
func (*Stream) SetWriteDeadline ¶
SetWriteDeadline sets the write deadline as defined by net.Conn.SetWriteDeadline. A zero time value disables the deadline.