TCP API file. More...
Go to the source code of this file.
Macros | |
#define | _DN_EXP_TCP |
Functions | |
_DN_EXP_TCP HRESULT | tcp_accept (int sock, int *client) |
TCP server accepts a TCP client. More... | |
_DN_EXP_TCP HRESULT | tcp_clear (int sock, uint32_t timeout) |
Clears the received buffer. More... | |
_DN_EXP_TCP HRESULT | tcp_close (int *sock) |
Closes the socket. More... | |
_DN_EXP_TCP HRESULT | tcp_open_client (void *param, int *sock) |
Opens TCP client. More... | |
_DN_EXP_TCP HRESULT | tcp_open_server (void *param, int *sock) |
Opens TCP server. More... | |
_DN_EXP_TCP HRESULT | tcp_recv (int sock, char *buf, uint32_t len_buf, uint32_t *len_recved, uint32_t timeout, void *arg) |
Receives TCP packet. More... | |
_DN_EXP_TCP HRESULT | tcp_send (int sock, const char *buf, uint32_t len_buf, void *arg) |
Sends TCP packet. More... | |
_DN_EXP_TCP HRESULT | tcp_set_keepalive (int sock, int enable, uint32_t idle, uint32_t interval, uint32_t count) |
Sets keep alive option. More... | |
_DN_EXP_TCP HRESULT | tcp_set_nodelay (int sock, int enable) |
Sets no delay option. More... | |
_DN_EXP_TCP HRESULT | tcp_set_timeout (int sock, uint32_t timeout) |
Sets timeout value to the TCP socket. More... | |
TCP API file.
Defines TCP APIs.
Software License Agreement (MIT License)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Definition in file dn_tcp.h.
HRESULT tcp_accept | ( | int | sock, |
int * | client | ||
) |
HRESULT tcp_close | ( | int * | sock | ) |
HRESULT tcp_open_client | ( | void * | param, |
int * | sock | ||
) |
Opens TCP client.
[in] | param | The pointer of Ethernet connection parameters: CONN_PARAM_ETH. |
[out] | sock | The created socket. |
HRESULT tcp_open_server | ( | void * | param, |
int * | sock | ||
) |
Opens TCP server.
[in] | param | The pointer of Ethernet connection parameters: CONN_PARAM_ETH. |
[out] | sock | The created socket. |
HRESULT tcp_set_keepalive | ( | int | sock, |
int | enable, | ||
uint32_t | idle, | ||
uint32_t | interval, | ||
uint32_t | count | ||
) |
Sets keep alive option.
[in] | sock | The TCP socket. |
[in] | enable | Enable option. 0: disable, 1: enable. |
[in] | idle | Idle time until sending keep alive packet. |
[in] | interval | Interval time between keep alive packet. |
[in] | count | The number of sending keep alive packet. |
HRESULT tcp_set_nodelay | ( | int | sock, |
int | enable | ||
) |