Documentation ¶
Overview ¶
Package packetbuffer implements functions for the manipulation of byte slices.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PacketBuffer ¶
type PacketBuffer struct {
// contains filtered or unexported fields
}
PacketBuffer encapsulates a packet connection and implements the io.Reader interface.
func New ¶
func New(conn net.PacketConn, size int) *PacketBuffer
New creates a packet buffer with specific packet connection and size.
func (*PacketBuffer) Close ¶
func (pb *PacketBuffer) Close()
Close closes this buffer and releases resource.
func (*PacketBuffer) CurrentPacketAddr ¶
func (pb *PacketBuffer) CurrentPacketAddr() net.Addr
CurrentPacketAddr returns current packet's remote address.
func (*PacketBuffer) Next ¶
func (pb *PacketBuffer) Next() error
Next is used to distinguish continuous logic reads. It indicates that the reading on current packet has finished. If there remains data unconsumed, Next returns an error and discards the remaining data.
Click to show internal directories.
Click to hide internal directories.