Embedded TCP/IP stack
4.7.0
|
fnet_return_t fnet_socket_listen | ( | fnet_socket_t | s, |
fnet_size_t | backlog | ||
) |
Places the socket into a state, where it is listening for an incoming connection.
s | Descriptor identifying a socket that will be used for listening. |
backlog | Maximum length of the queue of pending connections. |
Only connection-oriented sockets (SOCK_STREAM) are used with the fnet_socket_listen().
The socket is put into passive mode, where the incoming connection requests are acknowledged and queued pending acceptance by the listening socket. The fnet_socket_listen() function is typically used by servers that can have more than one connection request at a time.
An application can call fnet_socket_listen() more than once on the same socket. If there are more pending connections than the new backlog value, the excess pending connections will be reset and dropped. Once pending connections accepted by application using fnet_socket_accept(), they are removed from backlog.