NetApp_SockListen TCP

Set an application socket to listen for connection requests, with error handling. See section NetSock_Listen() for more information.

Files

net_app.h/net_app.c

Prototype

          CPU_BOOLEAN  NetApp_SockListen (NET_SOCK_ID       sock_id,
                                          NET_SOCK_Q_SIZE   sock_q_size,
                                          NET_ERR          *p_err);

Arguments

sock_id

This is the socket ID returned by NetApp_SockOpen()/ NetSock_Open()/socket() when the socket was created.

sock_q_size

Maximum number of new connections allowed to be waiting. In other words, this argument specifies the maximum queue length of pending connections while the listening socket is busy servicing the current request.

p_err

Pointer to variable that will receive the error code from this function:

NET_APP_ERR_NONE
NET_APP_ERR_INVALID_ARG
NET_APP_ERR_INVALID_OP
NET_APP_ERR_FAULT
NET_APP_ERR_FAULT_TRANSITORY

Returned Value

DEF_OK,

Application socket successfully set to listen.

DEF_FAIL,

otherwise.

Required Configuration

None.

Notes / Warnings

Some socket arguments and/or operations are validated only if validation code is enabled (see section Argument Check Configuration).