rmux

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidProtocol           = errors.New("invalid protocol")
	ErrConsumed                  = errors.New("peer consumed more than sent")
	ErrGoAway                    = errors.New("stream id overflows, should start a new connection")
	ErrTimeout         net.Error = &timeoutError{}
	ErrWouldBlock                = errors.New("operation would block on IO")
)

Functions

func NewShaperQueue

func NewShaperQueue() *shaperQueue

func VerifyConfig

func VerifyConfig(config *Config) error

Types

type Allocator

type Allocator struct {
}

func (*Allocator) Get

func (alloc *Allocator) Get(size int) []byte

func (*Allocator) Put

func (alloc *Allocator) Put(buffer []byte) error

type CLASSID

type CLASSID int32
const (
	CLSCTRL CLASSID = iota
	CLSDATA
)

type Config

type Config struct {
	Version int

	KeepAliveDisabled bool

	KeepAliveInterval time.Duration

	KeepAliveTimeout time.Duration

	MaxFrameSize int

	MaxStreamBuffer int

	StreamReadTimeout time.Duration

	IdleProbeAfter   time.Duration
	IdleProbeTimeout time.Duration
}

func DefaultConfig

func DefaultConfig() *Config

type Frame

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

type Session

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

func Client

func Client(conn io.ReadWriteCloser, config *Config) (*Session, error)

func Server

func Server(conn io.ReadWriteCloser, config *Config) (*Session, error)

func (*Session) Accept

func (s *Session) Accept() (io.ReadWriteCloser, error)

func (*Session) AcceptStream

func (s *Session) AcceptStream() (*Stream, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) IsClosed

func (s *Session) IsClosed() bool

func (*Session) LocalAddr

func (s *Session) LocalAddr() net.Addr

func (*Session) NumStreams

func (s *Session) NumStreams() int

func (*Session) Open

func (s *Session) Open() (io.ReadWriteCloser, error)

func (*Session) OpenStream

func (s *Session) OpenStream() (*Stream, error)

func (*Session) RemoteAddr

func (s *Session) RemoteAddr() net.Addr

func (*Session) SetDeadline

func (s *Session) SetDeadline(t time.Time) error

type Stream

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

func (*Stream) Close

func (s *Stream) Close() error

func (*Stream) CloseWrite

func (s *Stream) CloseWrite() error

func (*Stream) LocalAddr

func (s *Stream) LocalAddr() net.Addr

func (*Stream) Read

func (s *Stream) Read(b []byte) (n int, err error)

func (*Stream) RemoteAddr

func (s *Stream) RemoteAddr() net.Addr

func (*Stream) SetDeadline

func (s *Stream) SetDeadline(t time.Time) error

func (*Stream) SetReadDeadline

func (s *Stream) SetReadDeadline(t time.Time) error

func (*Stream) SetWriteDeadline

func (s *Stream) SetWriteDeadline(t time.Time) error

func (*Stream) Write

func (s *Stream) Write(b []byte) (n int, err error)

func (*Stream) WriteTo

func (s *Stream) WriteTo(w io.Writer) (n int64, err error)

Jump to

Keyboard shortcuts

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