laggon

package module
v0.0.0-...-36761a9 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

README

laggon

Go networking library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Packet

type Packet struct {
	Type PacketType
	Data []byte
}

func DecodePacket

func DecodePacket(data []byte) (*Packet, error)

func ReceivePacket

func ReceivePacket(conn net.Conn, bufferSize uint32) (*Packet, error)

func ReceivePacketTCP

func ReceivePacketTCP(conn net.TCPConn, bufferSize uint32) (*Packet, error)

func ReceivePacketUDP

func ReceivePacketUDP(conn net.UDPConn, bufferSize uint32) (*Packet, error)

func (Packet) Encode

func (p Packet) Encode() ([]byte, error)

func (Packet) Send

func (p Packet) Send(conn net.Conn) (int, error)

func (Packet) SendTCP

func (p Packet) SendTCP(conn net.TCPConn) (int, error)

func (Packet) SendUDP

func (p Packet) SendUDP(conn net.UDPConn) (int, error)

type PacketType

type PacketType uint32 // allows to define own types for games

Jump to

Keyboard shortcuts

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