Function SocketSelect() Professional
Determines the status of one or more sockets and waits, if necessary.
SocketSelect( [<nReadFD>] , ;
[<nWriteFD>] , ;
[<nExceptFD>], ;
[<aTimeOut>] , ;
[@<nError>] ) --> nNumberOfSockets
The function returns the total number of sockets that are ready and contained in the descriptor sets, or zero if the time limit expired. When an error occurs, a value of SOCKET_ERROR is returned.
This function monitors activity on groups of sockets to see if any sockets are ready for reading or writing, or if exceptional messages are pending (out-of-band data). Sockets are grouped by descriptor sets whose handles must be provided as parameters.
The parameter <nReadFD> identifies those sockets of the descriptor set which are to be checked for readability. Readability is given under the following conditions:
1. When a socket is listening to incoming connections and a connection is pending, SocketAccept() will complete without blocking.
2. If data is available for reading (includes OOB data if SO_OOBINLINE is enabled), the functions SocketRecv...() are guaranteed not to block.
3. Connection has been closed, reset or terminated. In this case SocketRecv() will not block, but no data will be read.
The parameter <nWriteFD> identifies the sockets to be checked for writability.
1. If a nonblocking socket is connecting, writability means that SocketConnect() successfully completed.
2. If the socket is not in the process of connecting, writability means that the functions SocketSend...() can be called successfully.
The presence of out-of-band data or any exceptional error conditions is checked for the sockets identified by <nExceptFD>. This applies to:
1. SocketConnect() failed.
2. Out-of-band data is available for reading (only if SO_OOBINLINE is disabled).
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.