package vendor:sdl2/net

Types

GenericSocket ¶

GenericSocket :: ^struct {
	ready: i32,
}
 

Any network socket can be safely cast to this socket type

IPaddress ¶

IPaddress :: struct {
	host: u32,
	port: u16,
}

SocketSet ¶

SocketSet :: distinct rawptr

TCPsocket ¶

TCPsocket :: distinct rawptr

UDPpacket ¶

UDPpacket :: struct {
	channel: i32,
	// The src/dst channel of the packet 
	data:    [^]u8,
	// The packet data 
	len:     i32,
	// The length of the packet data 
	maxlen:  i32,
	// The size of the data buffer 
	status:  i32,
	// packet status after sending 
	address: IPaddress,
}

UDPsocket ¶

UDPsocket :: distinct rawptr

bool ¶

bool :: sdl2.bool

Constants

INADDR_ANY ¶

INADDR_ANY :: 0x00000000

INADDR_BROADCAST ¶

INADDR_BROADCAST :: 0xFFFFFFFF

INADDR_LOOPBACK ¶

INADDR_LOOPBACK :: 0x7f000001

INADDR_NONE ¶

INADDR_NONE :: 0xFFFFFFFF

MAJOR_VERSION ¶

MAJOR_VERSION :: 2

MAX_UDPADDRESSES ¶

MAX_UDPADDRESSES :: 4
 

The maximum addresses bound to a single UDP socket channel

MAX_UDPCHANNELS ¶

MAX_UDPCHANNELS :: 32
 

The maximum channels on a a UDP socket

MINOR_VERSION ¶

MINOR_VERSION :: 0

PATCHLEVEL ¶

PATCHLEVEL :: 1

Variables

This section is empty.

Procedures

AddSocket ¶

AddSocket :: proc "cdecl" (set: SocketSet, sock: ^struct {ready: i32,}) -> i32 ---

AllocPacketV ¶

AllocPacketV :: proc "cdecl" (howmany: i32, size: i32) -> [^]^UDPpacket ---

AllocPacket ¶

AllocPacket :: proc "cdecl" (size: i32) -> ^UDPpacket ---

AllocPacketSlice ¶

AllocPacketSlice :: proc "cdecl" (howmany: i32, size: i32) -> []^UDPpacket {…}

AllocSocketSet ¶

AllocSocketSet :: proc "cdecl" (maxsockets: i32) -> SocketSet ---

CheckSockets ¶

CheckSockets :: proc "cdecl" (set: SocketSet, timeout: u32) -> i32 ---

DelSocket ¶

DelSocket :: proc "cdecl" (set: SocketSet, sock: ^struct {ready: i32,}) -> i32 ---

FreePacket ¶

FreePacket :: proc "cdecl" (packet: ^UDPpacket) ---

FreePacketSlice ¶

FreePacketSlice :: proc "cdecl" (packets: []^UDPpacket) {…}

FreePacketV ¶

FreePacketV :: proc "cdecl" (packetV: [^]^UDPpacket) ---

FreeSocketSet ¶

FreeSocketSet :: proc "cdecl" (set: SocketSet) ---

GetError ¶

GetError :: proc "cdecl" () -> cstring ---

GetLocalAddresses ¶

GetLocalAddresses :: proc "cdecl" (addresses: ^IPaddress, maxcount: i32) -> i32 ---

Init ¶

Init :: proc "cdecl" () -> i32 ---

Linked_Version ¶

Linked_Version :: proc "cdecl" () -> ^sdl2.version ---

Quit ¶

Quit :: proc "cdecl" () ---

Read16 ¶

Read16 :: proc "cdecl" (areap: rawptr) -> u16 {…}
 

Read a 16/32-bit value from network packet buffer

Read32 ¶

Read32 :: proc "cdecl" (areap: rawptr) -> u32 {…}

ResizePacket ¶

ResizePacket :: proc "cdecl" (packet: ^UDPpacket, newsize: i32) -> i32 ---

ResolveHost ¶

ResolveHost :: proc "cdecl" (address: ^IPaddress, host: cstring, port: u16) -> i32 ---

ResolveIP ¶

ResolveIP :: proc "cdecl" (ip: ^IPaddress) -> cstring ---

SetError ¶

SetError :: proc "cdecl" (fmt: cstring, args: ..any) ---

SocketReady ¶

SocketReady :: proc "cdecl" (sock: rawptr) -> sdl2.bool {…}

TCP_Accept ¶

TCP_Accept :: proc "cdecl" (server: TCPsocket) -> TCPsocket ---

TCP_AddSocket ¶

TCP_AddSocket :: proc "cdecl" (set: SocketSet, sock: TCPsocket) -> i32 {…}

TCP_Close ¶

TCP_Close :: proc "cdecl" (sock: TCPsocket) ---

TCP_DelSocket ¶

TCP_DelSocket :: proc "cdecl" (set: SocketSet, sock: TCPsocket) -> i32 {…}

TCP_GetPeerAddress ¶

TCP_GetPeerAddress :: proc "cdecl" (sock: TCPsocket) -> ^IPaddress ---

TCP_Open ¶

TCP_Open :: proc "cdecl" (ip: ^IPaddress) -> TCPsocket ---

TCP_Recv ¶

TCP_Recv :: proc "cdecl" (sock: TCPsocket, data: rawptr, len: i32) -> i32 ---

TCP_Send ¶

TCP_Send :: proc "cdecl" (sock: TCPsocket, data: rawptr, len: i32) -> i32 ---

UDP_AddSocket ¶

UDP_AddSocket :: proc "cdecl" (set: SocketSet, sock: UDPsocket) -> i32 {…}

UDP_Bind ¶

UDP_Bind :: proc "cdecl" (sock: UDPsocket, channel: i32, address: ^IPaddress) -> i32 ---

UDP_Close ¶

UDP_Close :: proc "cdecl" (sock: UDPsocket) ---

UDP_DelSocket ¶

UDP_DelSocket :: proc "cdecl" (set: SocketSet, sock: UDPsocket) -> i32 {…}

UDP_GetPeerAddress ¶

UDP_GetPeerAddress :: proc "cdecl" (sock: UDPsocket, channel: i32) -> IPaddress ---

UDP_Open ¶

UDP_Open :: proc "cdecl" (port: u16) -> UDPsocket ---

UDP_Recv ¶

UDP_Recv :: proc "cdecl" (sock: UDPsocket, packet: ^UDPpacket) -> i32 ---

UDP_RecvV ¶

UDP_RecvV :: proc "cdecl" (sock: UDPsocket, packets: [^]^UDPpacket) -> i32 ---

UDP_SendSlice ¶

UDP_SendSlice :: proc "cdecl" (sock: UDPsocket, packets: []^UDPpacket) -> i32 {…}

UDP_SendV ¶

UDP_SendV :: proc "cdecl" (sock: UDPsocket, packets: [^]^UDPpacket, npackets: i32) -> i32 ---

UDP_Send ¶

UDP_Send :: proc "cdecl" (sock: UDPsocket, channel: i32, packet: ^UDPpacket) -> i32 ---

UDP_SetPacketLoss ¶

UDP_SetPacketLoss :: proc "cdecl" (sock: UDPsocket, percent: i32) ---

UDP_Unbind ¶

UDP_Unbind :: proc "cdecl" (sock: UDPsocket, percent: i32) ---

Write16 ¶

Write16 :: proc "cdecl" (value: u16, areap: rawptr) {…}
 

Write a 16/32-bit value to network packet buffer

Write32 ¶

Write32 :: proc "cdecl" (value: u32, areap: rawptr) {…}

Procedure Groups

This section is empty.

Source Files

Generation Information

Generated with odin version dev-2022-07 (vendor "odin") Windows_amd64 @ 2022-07-01 21:08:58.688206200 +0000 UTC