SDL3_net

This page is under development.

SDL3_net.NET_AcceptClient(server: LP_NET_Server, client_stream: LP_LP_NET_StreamSocket) c_bool[source]

Create a stream socket for the next pending client connection.

SDL3_net.NET_CompareAddresses(a: LP_NET_Address, b: LP_NET_Address) c_int[source]

Compare two NET_Address objects.

SDL3_net.NET_CreateClient(address: LP_NET_Address, port: c_uint16) LP_NET_StreamSocket[source]

Begin connecting a socket as a client to a remote server.

SDL3_net.NET_CreateDatagramSocket(addr: LP_NET_Address, port: c_uint16) LP_NET_DatagramSocket[source]

Create and bind a new datagram socket.

SDL3_net.NET_CreateServer(addr: LP_NET_Address, port: c_uint16) LP_NET_Server[source]

Create a server, which listens for connections to accept.

SDL3_net.NET_DestroyDatagram(dgram: LP_NET_Datagram) None[source]

Dispose of a datagram packet previously received.

SDL3_net.NET_DestroyDatagramSocket(sock: LP_NET_DatagramSocket) None[source]

Dispose of a previously-created datagram socket.

SDL3_net.NET_DestroyServer(server: LP_NET_Server) None[source]

Dispose of a previously-created server.

SDL3_net.NET_DestroyStreamSocket(sock: LP_NET_StreamSocket) None[source]

Dispose of a previously-created stream socket.

SDL3_net.NET_FreeLocalAddresses(addresses: LP_LP_NET_Address) None[source]

Free the results from NET_GetLocalAddresses.

SDL3_net.NET_GetAddressStatus(address: LP_NET_Address) NET_Status[source]

Check if an address is resolved, without blocking.

SDL3_net.NET_GetAddressString(address: LP_NET_Address) c_char_p[source]

Get a human-readable string from a resolved address.

SDL3_net.NET_GetConnectionStatus(sock: LP_NET_StreamSocket) NET_Status[source]

Check if a stream socket is connected, without blocking.

SDL3_net.NET_GetLocalAddresses(num_addresses: LP_c_int) LP_LP_NET_Address[source]

Obtain a list of local addresses on the system.

SDL3_net.NET_GetStreamSocketAddress(sock: LP_NET_StreamSocket) LP_NET_Address[source]

Get the remote address of a stream socket.

SDL3_net.NET_GetStreamSocketPendingWrites(sock: LP_NET_StreamSocket) c_int[source]

Query bytes still pending transmission on a stream socket.

SDL3_net.NET_Init() c_bool[source]

Initialize the SDL_net library.

SDL3_net.NET_Quit() None[source]

Deinitialize the SDL_net library.

SDL3_net.NET_ReadFromStreamSocket(sock: LP_NET_StreamSocket, buf: c_void_p, buflen: c_int) c_int[source]

Receive bytes that a remote system sent to a stream socket.

SDL3_net.NET_ReceiveDatagram(sock: LP_NET_DatagramSocket, dgram: LP_LP_NET_Datagram) c_bool[source]

Receive a new packet that a remote system sent to a datagram socket.

SDL3_net.NET_RefAddress(address: LP_NET_Address) LP_NET_Address[source]

Add a reference to an NET_Address.

SDL3_net.NET_ResolveHostname(host: c_char_p) LP_NET_Address[source]

Resolve a human-readable hostname.

SDL3_net.NET_SendDatagram(sock: LP_NET_DatagramSocket, address: LP_NET_Address, port: c_uint16, buf: c_void_p, buflen: c_int) c_bool[source]

Send a new packet over a datagram socket to a remote system.

SDL3_net.NET_SimulateAddressResolutionLoss(percent_loss: c_int) None[source]

Enable simulated address resolution failures.

SDL3_net.NET_SimulateDatagramPacketLoss(sock: LP_NET_DatagramSocket, percent_loss: c_int) None[source]

Enable simulated datagram socket failures.

SDL3_net.NET_SimulateStreamPacketLoss(sock: LP_NET_StreamSocket, percent_loss: c_int) None[source]

Enable simulated stream socket failures.

SDL3_net.NET_UnrefAddress(address: LP_NET_Address) None[source]

Drop a reference to an NET_Address.

SDL3_net.NET_Version() c_int[source]

This function gets the version of the dynamically linked SDL_net library.

SDL3_net.NET_WaitUntilConnected(sock: LP_NET_StreamSocket, timeout: c_int32) NET_Status[source]

Block until a stream socket has connected to a server.

SDL3_net.NET_WaitUntilInputAvailable(vsockets: LP_c_void_p, numsockets: c_int, timeout: c_int32) c_int[source]

Block on multiple sockets until at least one has data available.

SDL3_net.NET_WaitUntilResolved(address: LP_NET_Address, timeout: c_int32) NET_Status[source]

Block until an address is resolved.

SDL3_net.NET_WaitUntilStreamSocketDrained(sock: LP_NET_StreamSocket, timeout: c_int32) c_int[source]

Block until all of a stream socket’s pending data is sent.

SDL3_net.NET_WriteToStreamSocket(sock: LP_NET_StreamSocket, buf: c_void_p, buflen: c_int) c_bool[source]

Send bytes over a stream socket to a remote system.