DDraceNetwork Docs
|
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_send (NETSOCKET sock, const void *data, int size) |
int | net_tcp_recv (NETSOCKET sock, void *data, int maxsize) |
int | net_tcp_close (NETSOCKET sock) |
Polls a listning socket for a new connection.
sock | - Listning 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 (optional, can be NULL). |
int 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. |
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 | ||
) |
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. |
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. |