socket_is_readable

Синтаксис

native socket_is_readable(_socket, _timeout = 100000);

Употреба

_socket
Socket descriptor
_timeout
Amount of time to block the call waiting for the socket to be marked as readable or
for the timeout to expire, in µSeconds (1 sec = 1000000 µsec)

Описание

Checks if a socket is marked as readable.

Забележка

You can use this function to make sure there's something on the socket and avoid a blocking call.

Забележка

Set _timeout to 0 avoid blocking the call.

Забележка

A socket will become readable if there's any data or an EOF.

Връщаща стойност

1 if the socket is marked as readable
0 otherwise