Function SocketListen() Professional

Establishes a socket to listen for an incoming connection.

Syntax
SocketListen( <nServerSocket>, ;
              [<nBackLog>]   , ;
              [@<nError>]      ) --> lSuccess
Parameters
<nSocket>
This is a numeric socket descriptor previously created with SocketNew() or SocketCreate().
<nBackLog>
<nBackLog> specifies the maximum number of outstanding connections which may be queued awaiting acceptance by the server process. The default value is 5.
<nError>
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.
Return

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

Description

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().

Feedback

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.