![]() |
DDraceNetwork Documentation
|
Functions | |
| NETSOCKET | net_udp_create (NETADDR bindaddr) |
| int | net_udp_send (NETSOCKET sock, const NETADDR *addr, const void *data, int size) |
| int | net_udp_recv (NETSOCKET sock, NETADDR *addr, unsigned char **data) |
| void | net_udp_close (NETSOCKET sock) |
Creates a UDP socket and binds it to a port.
| bindaddr | Address to bind the socket to. |
nullptr. Receives a packet over an UDP socket.
| sock | Socket to use. |
| addr | Pointer to an NETADDR that will receive the address. |
| data | Received data. Will be invalidated when this function is called again. |
-1 on error. Sends a packet over an UDP socket.
| sock | Socket to use. |
| addr | Where to send the packet. |
| data | Pointer to the packet data to send. |
| size | Size of the packet. |
-1 on error.