Embedded TCP/IP stack
4.7.0
|
fnet_socket_t fnet_socket | ( | fnet_address_family_t | family, |
fnet_socket_type_t | type, | ||
fnet_uint32_t | protocol | ||
) |
Creates a socket.
family | Address family that the socket will use, defined by the fnet_address_family_t. |
type | Type specification for the new socket, defined by fnet_socket_type_t. It can be SOCK_STREAM (TCP) or SOCK_DGRAM (UDP). |
protocol | Protocol to be used with the socket that is specific to the indicated address family. This stack supports IPPROTO_TCP and IPPROTO_UDP. This parameter is optional, and can be set to zero, as the type already defines the proper protocol. |
This function creates a socket and returns its descriptor.
The fnet_socket() function causes a socket descriptor and any related resources to be allocated and bound to a specific transport-service provider that supports the requested combination of address family, socket type, and protocol parameters.
After a socket is created: