mux

package
v0.2.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// SMUX Protocol version, support 1,2
	Version int

	// Disabled keepalive
	KeepAliveDisabled bool

	// 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

	// MaxStreamBuffer is used to control the maximum
	// number of data per stream
	MaxStreamBuffer int
}

type Session

type Session struct {
	// contains filtered or unexported fields
}

func ClientSession

func ClientSession(conn net.Conn, cfg *Config) (*Session, error)

func ServerSession

func ServerSession(conn net.Conn, cfg *Config) (*Session, error)

func (*Session) Accept

func (session *Session) Accept() (net.Conn, error)

func (*Session) Close

func (session *Session) Close() error

func (*Session) GetConn

func (session *Session) GetConn() (net.Conn, error)

func (*Session) IsClosed

func (session *Session) IsClosed() bool

func (*Session) NumStreams

func (session *Session) NumStreams() int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL