xHarbour Reference Documentation > Function Reference |
Tests if incoming data is available to be read.
INetDataReady( <pSocket> , [<nMilliSecs>] ) --> nResult
The function returns 1 if incoming data on <pSocket> is detected, or 0 if no data is available. When a network error occurs, the return value is -1.
Function INetDataReady() is used to detect if data is available to be read from <pSocket> without blocking program execution. If <nMillisecs> is not specified, the function returns immediately 1 when there is some data to be read. It returns 0, if there is no data, and -1 in case of error. If <nMillisecs> is given, the functon waits for this amount of time for incoming data. If some data arrives during that period of time, the wait state is immediately terminated and the function returns 1.
If incoming data is detected, a subsequent call to InetRecv() will read available data, up to the requested length, without blocking program execution.
If an error occurs, InetErrorCode() can be used to determine the cause of failure.
See also: | INetAccept(), INetConnect(), INetCount(), INetRecv(), INetRecvAll() |
Category: | Internet functions , Sockets functions , xHarbour extensions |
Source: | vm\INet.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
http://www.xHarbour.com