Embedded TCP/IP stack  4.7.0

◆ fnet_socket_listen()

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.

Parameters
sDescriptor identifying a socket that will be used for listening.
backlogMaximum length of the queue of pending connections.
Returns
This function returns:
See also
fnet_socket(), fnet_socket_bind(), fnet_socket_accept()

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.


© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net