Documentation ¶
Overview ¶
Package mux multiplexes packets on a single socket (RFC7983)
Index ¶
- func MatchAll([]byte) bool
- func MatchDTLS(b []byte) bool
- func MatchRange(lower, upper byte, buf []byte) bool
- func MatchSRTCP(buf []byte) bool
- func MatchSRTP(buf []byte) bool
- func MatchSRTPOrSRTCP(b []byte) bool
- type Config
- type Endpoint
- func (e *Endpoint) Close() (err error)
- func (e *Endpoint) LocalAddr() net.Addr
- func (e *Endpoint) Read(p []byte) (int, error)
- func (e *Endpoint) ReadFrom(p []byte) (int, net.Addr, error)
- func (e *Endpoint) RemoteAddr() net.Addr
- func (e *Endpoint) SetDeadline(time.Time) error
- func (e *Endpoint) SetOnClose(onClose func())
- func (e *Endpoint) SetReadDeadline(time.Time) error
- func (e *Endpoint) SetWriteDeadline(time.Time) error
- func (e *Endpoint) Write(p []byte) (int, error)
- func (e *Endpoint) WriteTo(p []byte, _ net.Addr) (int, error)
- type MatchFunc
- type Mux
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchDTLS ¶
MatchDTLS is a MatchFunc that accepts packets with the first byte in [20..63] as defied in RFC7983
func MatchRange ¶
MatchRange returns true if the first byte of buf is in [lower..upper]
func MatchSRTCP ¶
MatchSRTCP is a MatchFunc that only matches SRTCP and not SRTP
func MatchSRTPOrSRTCP ¶
MatchSRTPOrSRTCP is a MatchFunc that accepts packets with the first byte in [128..191] as defied in RFC7983
Types ¶
type Config ¶
type Config struct { Conn net.Conn BufferSize int LoggerFactory logging.LoggerFactory }
Config collects the arguments to mux.Mux construction into a single structure
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint implements net.Conn. It is used to read muxed packets.
func (*Endpoint) Read ¶
Read reads a packet of len(p) bytes from the underlying conn that are matched by the associated MuxFunc
func (*Endpoint) ReadFrom ¶
ReadFrom reads a packet of len(p) bytes from the underlying conn that are matched by the associated MuxFunc
func (*Endpoint) SetDeadline ¶
SetDeadline is a stub
func (*Endpoint) SetOnClose ¶
func (e *Endpoint) SetOnClose(onClose func())
SetOnClose is a user set callback that will be executed when `Close` is called
func (*Endpoint) SetReadDeadline ¶
SetReadDeadline is a stub
func (*Endpoint) SetWriteDeadline ¶
SetWriteDeadline is a stub
type Mux ¶
type Mux struct {
// contains filtered or unexported fields
}
Mux allows multiplexing
func (*Mux) NewEndpoint ¶
NewEndpoint creates a new Endpoint
func (*Mux) RemoveEndpoint ¶
RemoveEndpoint removes an endpoint from the Mux