util

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoAddress = errors.New("No address to write to")

ErrNoAddress indicates that the ReadWriter has not read a packet from a remote source and cannot determine where to write packets to

Functions

func CStrLen

func CStrLen(input []byte) int

CStrLen returns the length of the null-terminated C string contained in the input buffer

func TruncateV2

func TruncateV2(input []byte) []byte

Types

type UDPReadWriteCloser

type UDPReadWriteCloser struct {
	sync.Mutex
	// contains filtered or unexported fields
}

UDPReadWriteCloser implements io.ReadWriter semantics on top of a UDP packet connection

func NewUDPReadWriteCloser

func NewUDPReadWriteCloser(address string, port int) (*UDPReadWriteCloser, error)

NewUDPReadWriteCloser creates a new instance of UDPReadWriter

func (*UDPReadWriteCloser) Close

func (stream *UDPReadWriteCloser) Close() error

Close closes the underlying UDP connection

func (*UDPReadWriteCloser) Read

func (stream *UDPReadWriteCloser) Read(p []byte) (int, error)

func (*UDPReadWriteCloser) Write

func (stream *UDPReadWriteCloser) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL