Documentation ¶
Index ¶
- Constants
- Variables
- func Marshal(streamID string, data []byte) ([]byte, error)
- func Unmarshal(data []byte) (string, []byte, error)
- type Conn
- type Params
- type StringMux
- func (m *StringMux) AcceptConn() (Conn, error)
- func (m *StringMux) Close() error
- func (m *StringMux) Conns() <-chan Conn
- func (m *StringMux) Done() <-chan struct{}
- func (m *StringMux) GetConn(streamID string) (Conn, error)
- func (m *StringMux) LocalAddr() net.Addr
- func (m *StringMux) RemoteAddr() net.Addr
Constants ¶
View Source
const ( StringMuxByte uint8 = 0b11001000 MaxLenStreamID int = 0xFF )
View Source
const DefaultMTU uint32 = 8192
Variables ¶
View Source
var ( ErrConnAlreadyExists = errors.New("connection already exists") ErrConnNotFound = errors.New("connection not found") )
View Source
var ( ErrStreamIDTooLarge = errors.New("stream id too large") ErrInvalidHeader = errors.New("invalid first byte") )
Functions ¶
Types ¶
type StringMux ¶
type StringMux struct {
// contains filtered or unexported fields
}
func (*StringMux) AcceptConn ¶
AcceptConn reads from Conns channel. It returns io.ErrClosedPipe when the channel is closed. Users should use either AcceptConn or Conns, but never both.
func (*StringMux) Conns ¶
Conns is the channel with incoming connections. Users should use either AcceptConn or Conns, but never both.
func (*StringMux) RemoteAddr ¶
Click to show internal directories.
Click to hide internal directories.