Function SocketListen() Professional

Establishes a socket to listen for an incoming connection.

SocketListen( <nServerSocket>, ;
              [<nBackLog>]   , ;
              [@<nError>]      ) --> lSuccess
This is a numeric socket descriptor previously created with SocketNew() or SocketCreate().
<nBackLog> specifies the maximum number of outstanding connections which may be queued awaiting acceptance by the server process. The default value is 5.
If this parameter is passed by reference to the function, it gets assigned a numeric error code when the function fails. #define constants beginning with WSAE are available in the file SOCKET.CH to identify an error condition.

The function returns .T. (true) when the socket entered the listening state, otherwise .F. (false) is returned.


This function is used on the server side of a communication channel. It turns a socket into listening mode so that it can accept incoming communication requests from client stations. The function SocketAccept() must then be called by the server process to respond to SocketConnect() calls ocurring in client processes. SocketConnect() puts a connection request into the queue on the server side where is is retrieved from with SocketAccept().


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.