![]() |
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. |
| void net_tcp_close | ( | NETSOCKET | sock | ) |
Closes a TCP socket.
| sock | Socket to close. |
Connects one socket to another.
| sock | Socket to connect. |
| addr | Address to connect to. |
Connect a socket to a TCP address without blocking.
| sock | The socket to connect with. |
| bindaddr | The address to connect to. |
Creates a TCP socket.
| bindaddr | Address to bind the socket to. |
| int net_tcp_listen | ( | NETSOCKET | sock, |
| int | backlog ) |
Makes the socket start listening for new connections.
| sock | Socket to start listen to. |
| backlog | Size of the queue of incoming connections to keep. |
| int net_tcp_recv | ( | NETSOCKET | sock, |
| void * | data, | ||
| int | maxsize ) |
Receives data from a TCP stream.
| sock | Socket to recvive data from. |
| data | Pointer to a buffer to write the data to. |
| maxsize | Maximum of data to write to the buffer. |
| int net_tcp_send | ( | NETSOCKET | sock, |
| const void * | data, | ||
| int | size ) |
Sends data to a TCP stream.
| sock | Socket to send data to. |
| data | Pointer to the data to send. |
| size | Size of the data to send. |