%SS_SELECT

Wait for data

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %SS_SELECT(socket, seconds, microseconds)

Return value

status

If successful, returns SS_SUCCESS (0) one of the errors in Error codes returned by %SS_SELECT below. (n)

Arguments

socket

A descriptor of an open socket created by %SS_SOCKET. (i4)

seconds

The number of seconds to wait for data to arrive on the socket. (n)

microseconds

The number of microseconds to wait for data to arrive on the socket. (n)

Discussion

Because it is virtually impossible to know when a message is going to be sent or how long it is going to be, you can use %SS_SELECT to wait for data to arrive on the specified socket or for the specified time to expire. If data is already available, %SS_SELECT returns immediately. If the specified time elapses before the message arrives, %SS_SELECT returns control to the calling program so that other computations may be performed before checking again to see if the message has arrived.

Seconds and microseconds can be used together to indicate traditional time. For example, if you want to wait 10.234 seconds, the seconds argument would be 10 and the microseconds argument would be 234000.

If a socket is lost while waiting for a packet, %SS_SELECT returns immediately but does not indicate that an error has occurred. See Handling lost sockets for more information.

If %SS_SELECT returns ‑1 and %SYSERR has SS_EINTR, retry the operation.

Error codes returned by %SS_SELECT

See the Socket Errors table for additional information about these errors.

SS_EBADF

SS_EINTR

SS_ENETDOWN

SS_ENOBUFS

SS_ENOTCONN

SS_ENOTSOCK

SS_ETIMEDOUT

SS_EUNKNOWN

SS_NOTINITIALISED