Socket.select

Wait for a socket to change status. A wait timeout of core.time.Duration or TimeVal, may be specified; if a timeout is not specified or the TimeVal is null, the maximum timeout is used. The TimeVal timeout has an unspecified value when select returns.

Return Value

Type: int

The number of sockets with status changes, 0 on timeout, or -1 on interruption. If the return value is greater than 0, the SocketSets are updated to only contain the sockets having status changes. For a connecting socket, a write status change means the connection is established and it's able to send. For a listening socket, a read status change means there is an incoming connection request and it's able to accept.

SocketSet's updated to include only those sockets which an event occured. For a connect()ing socket, writeability means connected. For a listen()ing socket, readability means listening Winsock; possibly internally limited to 64 sockets per set.

the number of events, 0 on timeout, or -1 on interruption

Meta