Home |
Function listen |
Function listenPlace a socket in a state where it is listening for an incoming connection. int listen(SOCKET socket, int backlogsize); ParameterssocketBound and unconnected socket returned by socket. backlogsizeMaximum number of pending connections allowed. return valueReturns 0 if successful, otherwise SOCKET_ERROR. If an error occurred, call xn_getlasterror and xn_geterror_string to return the error value. Section Error Codes further describes each error. Possible values for this function are:
This function establishes a queue for an incoming connection on a socket. After calling listen, server applications call accept to establish a connection with a client and an associated socket and then create a new thread for the connection. The listen call allows a backlog of client connection requests to be queued up for processing by the server. Without listen, the client connection requests would be rejected. If backlogsize contains an invalid value (less than 1 or greater than CFG_TCP_MAX_CONN), backlogsize is set to the nearest valid value. This function is for TCP only.
|