Data Structures | |
struct | tcp_socket |
TCP socket information structure. More... | |
struct | tcp_socket |
TCP socket information structure. More... | |
Defines | |
#define | SO_FIN |
\brief Send FIN after all data has been transmitted. | |
#define | SO_SYN |
\brief Send SYN first. | |
#define | SO_FORCE |
\brief Force sending ACK. | |
#define | SO_ACK |
\brief Send ACK. | |
#define | TICK_RATE |
Typedefs | |
typedef struct tcp_socket | TCPSOCKET |
TCP socket type. | |
Functions | |
void | NutTcpDestroySocket (TCPSOCKET *sock) |
Destroy a previously allocated socket. More... | |
TCPSOCKET* | NutTcpFindSocket (u_short lport, u_short rport, u_long raddr) |
Find a matching socket. More... | |
TCPSOCKET* | NutTcpCreateSocket (void) |
Create a TCP socket. More... | |
int | NutTcpConnect (TCPSOCKET *sock, u_long addr, u_short port) |
Connect to a remote socket. More... | |
int | NutTcpAccept (TCPSOCKET *sock, u_short port) |
Wait for incoming connect from a remote socket. More... | |
int | NutTcpSend (TCPSOCKET *sock, void *data, u_short len) |
Send data on a connected TCP socket. More... | |
int | NutTcpReceive (TCPSOCKET *sock, void *data, u_short size) |
Receive data on a connected TCP socket. More... | |
int | NutTcpCloseSocket (TCPSOCKET *sock) |
Close TCP socket. More... | |
int | NutTcpError (TCPSOCKET *sock) |
Return specific code of the last error. More... | |
Variables | |
TCPSOCKET* | tcpSocketList |
|
Wait for incoming connect from a remote socket.
The calling thread will be suspended until until an incoming connection request is received. This function is typically used by TCP server applications.
|
|
Close TCP socket.
Note, that the socket is not immediately destroyed after calling this function. However, the application must not use the socket after this call.
|
|
Connect to a remote socket.
This function tries to establish a connection to the specified remote port of the specified remote server. The calling thread will be suspended until a connection is successfully established or an error occurs. This function is typically used by TCP client applications.
|
|
Create a TCP socket.
Allocates a TCPSOCKET structure from heap memory, initializes it and returns a pointer to that structure. The first call will also start the TCP timer, which is required by various timeout checks.
|
|
Destroy a previously allocated socket.
Remove socket from the socket list and release occupied memory. Applications typically do not need to call this function. It is automatically called by a timer after the socket has been closed by NutTcpCloseSocket().
|
|
Return specific code of the last error.
Possible error codes (net/errno.h) are:
|
|
Find a matching socket.
Loop through all sockets and find a matching connection (prefered) or a listening socket. Applications typically do not need to call this function.
|
|
Receive data on a connected TCP socket.
|
|
Send data on a connected TCP socket.
|
|
Linked list of all TCP sockets. |