Documentation
¶
Index ¶
- Constants
- func NewPipe(log *slog.Logger, buf int) (srv *PipeConn, cli *PipeConn)
- type Conn
- func (p *Conn) Ack() error
- func (p *Conn) CancelReliable(pid PID)
- func (p *Conn) DeleteQueue(fnc func(id QueueID, msgs []netmsg.Message) bool)
- func (p *Conn) EncodeState() *netmsg.State
- func (p *Conn) Encrypt(key byte)
- func (p *Conn) OnMessage(fnc OnMessageFunc)
- func (p *Conn) Port() *Port
- func (p *Conn) QueueReliable(sid SID, opts Options, msgs ...netmsg.Message) PID
- func (p *Conn) QueuedFor(sid SID, ops ...netmsg.Op) int
- func (p *Conn) RemoteAddr() netip.AddrPort
- func (p *Conn) Reset()
- func (p *Conn) ResetFor(sid SID)
- func (p *Conn) SendQueue() error
- func (p *Conn) SendReliable(ctx context.Context, sid SID, msgs ...netmsg.Message) error
- func (p *Conn) SendUnreliable(sid SID, msgs ...netmsg.Message) error
- func (p *Conn) Stream(sid SID) Stream
- func (p *Conn) ViewQueue(fnc func(id QueueID, m netmsg.Message))
- type Header
- type OnMessageFunc
- type Options
- type PID
- type PacketConn
- type PacketFlags
- type PipeConn
- type Port
- func (p *Port) BroadcastMsg(port int, m netmsg.Message) error
- func (p *Port) Close()
- func (p *Port) Conn(addr netip.AddrPort) *Conn
- func (p *Port) LocalAddr() netip.AddrPort
- func (p *Port) OnMessage(fnc OnMessageFunc)
- func (p *Port) Reset()
- func (p *Port) Start()
- func (p *Port) WriteMsg(addr netip.AddrPort, xor byte, hdr Header, enc *netmsg.State, ...) error
- type QueueID
- type SID
- type Seq
- type Stream
- func (p Stream) Addr() netip.AddrPort
- func (p Stream) CancelReliable(id PID)
- func (p Stream) Conn() *Conn
- func (p Stream) OnMessage(fnc OnMessageFunc)
- func (p Stream) QueueReliable(opts Options, msgs ...netmsg.Message) PID
- func (p Stream) Reset()
- func (p Stream) SID() SID
- func (p Stream) SendQueue() error
- func (p Stream) SendReliable(ctx context.Context, msgs ...netmsg.Message) error
- func (p Stream) SendUnreliable(msgs ...netmsg.Message) error
- func (p Stream) Valid() bool
Constants ¶
View Source
const ( MaxStreams = 128 ServerStreamID = SID(0) MaxStreamID = SID(MaxStreams - 1) )
View Source
const ( Unreliable = PacketFlags(0) Reliable = PacketFlags(1 << iota) )
View Source
const (
DefaultPort = 18590
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) CancelReliable ¶
func (*Conn) DeleteQueue ¶
func (*Conn) EncodeState ¶
func (*Conn) OnMessage ¶
func (p *Conn) OnMessage(fnc OnMessageFunc)
func (*Conn) QueueReliable ¶
func (*Conn) RemoteAddr ¶
func (*Conn) SendReliable ¶
type Header ¶
type Header struct { SID SID Seq Seq Flags PacketFlags }
type OnMessageFunc ¶
type OnMessageFunc func(s Stream, m netmsg.Message, flags PacketFlags) bool
type PacketConn ¶
type PacketFlags ¶
type PacketFlags byte
func (PacketFlags) Has ¶
func (f PacketFlags) Has(f2 PacketFlags) bool
type PipeConn ¶
type PipeConn struct { Log *slog.Logger Addr netip.AddrPort Port *Port Drop func(data []byte) bool Debug bool // contains filtered or unexported fields }
func (*PipeConn) ReadFromUDPAddrPort ¶
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (Stream) CancelReliable ¶
func (Stream) OnMessage ¶
func (p Stream) OnMessage(fnc OnMessageFunc)
func (Stream) QueueReliable ¶
func (Stream) SendReliable ¶
Click to show internal directories.
Click to hide internal directories.