![]() |
DDraceNetwork Documentation
|
Functions | |
| NETSOCKET | net_tcp_create (NETADDR bindaddr) |
| int | net_tcp_listen (NETSOCKET sock, int backlog) |
| int | net_tcp_accept (NETSOCKET sock, NETSOCKET *new_sock, NETADDR *addr) |
| int | net_tcp_connect (NETSOCKET sock, const NETADDR *addr) |
| int | net_tcp_connect_non_blocking (NETSOCKET sock, NETADDR bindaddr) |
| int | net_tcp_send (NETSOCKET sock, const void *data, int size) |
| int | net_tcp_recv (NETSOCKET sock, void *data, int maxsize) |
| void | net_tcp_close (NETSOCKET sock) |
Polls a listening socket for a new connection.
| sock | Listening socket to poll. |
| new_sock | Pointer to a socket to fill in with the new socket. |
| addr | Pointer to an address that will be filled in the remote address, can be nullptr. |
Connects one socket to another.
| sock | Socket to connect. |
| addr | Address to connect to. |
0 on success. Connect a socket to a TCP address without blocking.
| sock | The socket to connect with. |
| bindaddr | The address to connect to. |
0 on success. Creates a TCP socket.
| bindaddr | Address to bind the socket to. |
nullptr. Makes the socket start listening for new connections.
| sock | Socket to start listen to. |
| backlog | Size of the queue of incoming connections to keep. |
0 on success. Recvives data from a TCP stream.
| sock | Socket to recvive data from. |
| data | Pointer to a buffer to write the data to. |
| max_size | Maximum of data to write to the buffer. |