Result = ReceiveNetworkData(Connection, *DataBuffer, DataBufferLength)Description
Receives raw data from the specified client. This function can be used by both client and server applications and should be called only after having received a #PB_NetworkEvent_Data event.
Connection The connection to receive data from. On the server side 'Connection' is the client which has send the data (can be easily obtained with EventClient()). On client side, 'Connection' is returned by OpenNetworkConnection(). *DataBuffer The memory address to receive the data to. DataBufferLength The length of the buffer to receive data to.
Returns the number of bytes received. If 'Result' is equal to DataBufferLength then more data is available to be read. If an error occurred 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.
NetworkClientEvent(), NetworkServerEvent(), SendNetworkData()