Documentation
¶
Index ¶
- func WrapConn(conn net.Conn, bytes []byte, pool BufferPool) net.Conn
- type BackBuffer
- type BackPacketBuffer
- type BufferPool
- type Packet
- type PutBackConn
- type PutBackPacketConn
- type PutBackReadCloser
- type PutBackReadWriteCloser
- type PutBackReadWriter
- type PutBackReader
- type PutBackTCPConn
- type PutBackUDPConn
- func (pb *PutBackUDPConn) Close() error
- func (pb *PutBackUDPConn) PutBack(bytes []byte, addr *net.UDPAddr)
- func (pb *PutBackUDPConn) Read(p []byte) (n int, err error)
- func (pb *PutBackUDPConn) ReadFrom(p []byte) (n int, addr net.Addr, err error)
- func (pb *PutBackUDPConn) ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error)
- func (pb *PutBackUDPConn) ReadFromUDPAddrPort(b []byte) (n int, addr netip.AddrPort, err error)
- func (pb *PutBackUDPConn) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error)
- func (pb *PutBackUDPConn) ReadMsgUDPAddrPort(b, oob []byte) (n, oobn, flags int, addr netip.AddrPort, err error)
- type TCPConn
- type UDPConn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BackBuffer ¶
type BackBuffer struct {
Bytes []byte // May be nil
Pointer int
Pool BufferPool // May be nil
}
func (*BackBuffer) BytesLeft ¶
func (b *BackBuffer) BytesLeft() int
func (*BackBuffer) PutBack ¶
func (b *BackBuffer) PutBack(bytes []byte)
func (*BackBuffer) Read ¶
func (b *BackBuffer) Read(p []byte) (n int, err error)
Never returns error
func (*BackBuffer) Wipe ¶
func (b *BackBuffer) Wipe()
type BackPacketBuffer ¶
type BackPacketBuffer[T any] struct { Packets []Packet[T] // May be nil Pool BufferPool // May be nil }
func (*BackPacketBuffer[T]) PacketsLeft ¶
func (b *BackPacketBuffer[T]) PacketsLeft() int
func (*BackPacketBuffer[T]) PutBack ¶
func (b *BackPacketBuffer[T]) PutBack(bytes []byte, Assoc T)
func (*BackPacketBuffer[T]) ReadFrom ¶
func (b *BackPacketBuffer[T]) ReadFrom(p []byte) (n int, assoc T, err error)
Never returns error
func (*BackPacketBuffer[T]) Wipe ¶
func (b *BackPacketBuffer[T]) Wipe()
type BufferPool ¶
type PutBackConn ¶
type PutBackConn struct {
net.Conn
Buffer BackBuffer
}
func (*PutBackConn) Close ¶
func (pb *PutBackConn) Close() error
func (*PutBackConn) PutBack ¶
func (pb *PutBackConn) PutBack(bytes []byte)
type PutBackPacketConn ¶
type PutBackPacketConn struct {
net.PacketConn
Buffer BackPacketBuffer[net.Addr]
}
func (*PutBackPacketConn) Close ¶
func (pb *PutBackPacketConn) Close() error
type PutBackReadCloser ¶
type PutBackReadCloser struct {
io.ReadCloser
Buffer BackBuffer
}
func (*PutBackReadCloser) Close ¶
func (pb *PutBackReadCloser) Close() error
func (*PutBackReadCloser) PutBack ¶
func (pb *PutBackReadCloser) PutBack(bytes []byte)
type PutBackReadWriteCloser ¶
type PutBackReadWriteCloser struct {
io.ReadWriteCloser
Buffer BackBuffer
}
func (*PutBackReadWriteCloser) Close ¶
func (pb *PutBackReadWriteCloser) Close() error
func (*PutBackReadWriteCloser) PutBack ¶
func (pb *PutBackReadWriteCloser) PutBack(bytes []byte)
type PutBackReadWriter ¶
type PutBackReadWriter struct {
io.ReadWriter
Buffer BackBuffer
}
func (*PutBackReadWriter) PutBack ¶
func (pb *PutBackReadWriter) PutBack(bytes []byte)
type PutBackReader ¶
type PutBackReader struct {
io.Reader
Buffer BackBuffer
}
func (*PutBackReader) PutBack ¶
func (pb *PutBackReader) PutBack(bytes []byte)
type PutBackTCPConn ¶
type PutBackTCPConn struct {
TCPConn
Buffer BackBuffer
}
func (*PutBackTCPConn) Close ¶
func (pb *PutBackTCPConn) Close() error
func (*PutBackTCPConn) CloseRead ¶
func (pb *PutBackTCPConn) CloseRead() error
func (*PutBackTCPConn) PutBack ¶
func (pb *PutBackTCPConn) PutBack(bytes []byte)
type PutBackUDPConn ¶
type PutBackUDPConn struct {
UDPConn
Buffer BackPacketBuffer[*net.UDPAddr]
}
func (*PutBackUDPConn) Close ¶
func (pb *PutBackUDPConn) Close() error
func (*PutBackUDPConn) ReadFromUDP ¶
func (*PutBackUDPConn) ReadFromUDPAddrPort ¶
func (*PutBackUDPConn) ReadMsgUDP ¶
func (*PutBackUDPConn) ReadMsgUDPAddrPort ¶
type TCPConn ¶
type TCPConn interface {
net.Conn
ReadFrom(r io.Reader) (int64, error)
CloseRead() error
CloseWrite() error
File() (f *os.File, err error)
MultipathTCP() (bool, error)
SetKeepAlive(keepalive bool) error
SetKeepAliveConfig(config net.KeepAliveConfig) error
SetKeepAlivePeriod(d time.Duration) error
SetLinger(sec int) error
SetNoDelay(noDelay bool) error
SetReadBuffer(bytes int) error
SetWriteBuffer(bytes int) error
SyscallConn() (syscall.RawConn, error)
WriteTo(w io.Writer) (int64, error)
}
type UDPConn ¶
type UDPConn interface {
net.PacketConn
net.Conn
File() (f *os.File, err error)
ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error)
ReadFromUDPAddrPort(b []byte) (n int, addr netip.AddrPort, err error)
ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error)
ReadMsgUDPAddrPort(b, oob []byte) (n, oobn, flags int, addr netip.AddrPort, err error)
RemoteAddr() net.Addr
SetWriteBuffer(bytes int) error
SyscallConn() (syscall.RawConn, error)
WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error)
WriteMsgUDPAddrPort(b, oob []byte, addr netip.AddrPort) (n, oobn int, err error)
WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)
WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (int, error)
}
Click to show internal directories.
Click to hide internal directories.