Socket API file. More...
Go to the source code of this file.
Macros | |
#define | _DN_EXP_SOCKET |
Functions | |
_DN_EXP_SOCKET HRESULT | socket_bind (const struct CONN_PARAM_ETH *param, int *sock) |
Binds the socket with param's source address and source port. More... | |
_DN_EXP_SOCKET HRESULT | socket_close (int *sock) |
Closes the socket. More... | |
_DN_EXP_SOCKET HRESULT | socket_open (int type, int *sock) |
Creates a socket. More... | |
_DN_EXP_SOCKET HRESULT | socket_set_timeout (int sock, uint32_t timeout) |
Sets timeout value to the socket. More... | |
Socket API file.
Defines socket 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_socket.h.
#define _DN_EXP_SOCKET |
Definition at line 37 of file dn_socket.h.
HRESULT socket_bind | ( | const struct CONN_PARAM_ETH * | param, |
int * | sock | ||
) |
Binds the socket with param's source address and source port.
[in] | param | The pointer of Ethernet connection parameters. |
[in,out] | sock | The socket to be binded. |
Definition at line 211 of file dn_socket.c.
HRESULT socket_close | ( | int * | sock | ) |
Closes the socket.
[in,out] | sock | The socket to be closed. |
Definition at line 176 of file dn_socket.c.
HRESULT socket_open | ( | int | type, |
int * | sock | ||
) |
Creates a socket.
[in] | type | The socket type. Allows SOCK_STREAM or SOCK_DGRAM. |
[out] | sock | The created socket. |
Definition at line 129 of file dn_socket.c.
Sets timeout value to the socket.
[in] | sock | The socket to be set. |
[in] | timeout | Timeout value. |
Definition at line 255 of file dn_socket.c.