@IPIsDataAvailable
Syntax
@IPIsDataAvailable(IPSOCKET1);
Description
Currently available for Windows only!!!
For an IP connection, returns IPSOCKET IPSOCKET1 whether data has been received. The return value is 0 or 1. If the IPSOCKET is no longer available (TCP), the return value is an @ERROR.
Example: @IPIsDataAvailable(IPSOCKET1);
IPSOCKET1:=@IPOpenReceiveSocket("";80;"TCP");
IF(@GetDataType(IPSOCKET1)="IPS")
{
LOOP:=1;
WHILE(LOOP)
{
ConSocket:=@IPWaitForConnection(IPSOCKET1;RETIPHOST2);
IF(@GetDataType(ConSocket)="IPS")
{
DataAvailable:=@IPIsDataAvailable(ConSocket);
@LogReport(DataAvailable);
ConSocket:=@IPCloseSocket(ConSocket);
}
LOOP:=!@TaskShouldStop;
}
IPSOCKET1:=@IPCloseSocket(IPSOCKET1);
}
A receiving IPSOCKET is opened and waits for incoming requests
(Until the task is terminated with "Tell engine stop X" or the engine itself is terminated with "Tell engine e".)
When a request is received, the new IPSOCKET ConSocket is checked for available data.
The result of this query is output (variable DataAvailable).
The new IPSOCKET ConSocket is also closed again.
When the task is terminated, the receiving IPSOCKET IPSOCKET1 is also closed again.
Note : This text was machine-translated and may contain inaccuracies.
