Function SocketAccept() Professional

Waits until a connection is present.

Syntax
SocketAccept( <nServerSocket>, ;
              [@<nError>]      ) --> nSocket
Parameters
<nServerSocket>
This is a numeric socket descriptor previously created with SocketNew() or SocketCreate().
<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 a socket descriptor for an incoming connection.

Description

The function SocketAccept() is used by a server process for accepting client requests. Before connections can be accepted, a socket must listen to incoming requests which is achieved with the SocketListen() function. When a client connects to the server, SocketAccept() returns a new socket descriptor which can be used for data exchange with the client process. The original socket <nServerSocket> remains open and may accept new client connections. If there is no client request, the server process is blocked until a client connects to the server, unless the server socket is in nonblocking mode.

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.