ReceiveNetworkData()

Syntax

Result = ReceiveNetworkData(Connection, *DataBuffer, DataBufferLength)
Description
Receives a raw data from the specified client. This function can be used by both client and server applications.

On the server side 'Connection' is the client which has send the data (ClientID can be easily obtained with EventClient()).
On client side, 'Connection' is returned by OpenNetworkConnection().

The data is read into the specified *DataBuffer. A memory area can be created using AllocateMemory().

The 'Result' returns the number of bytes effectively read. If 'Result' is equal to DataBufferLength, then more data is available to be read. If an error occured on the connection (link broken, connection close by the server etc.), 'Result' will be -1.

On UDP connections, the maximum 'DataBufferLength' is 2048. On TCP connections, the maximum 'DataBufferLength' is 65536.

Supported OS

All

<- OpenNetworkConnection() - Network Index - ReceiveNetworkFile() ->