soRecv (Function) |
Top Previous Next |
The soRecv function receives data from a socket. The function return any data available, up to the requested amount, rather than waiting for receipt of the full amount requested.
On a blocking socket, the function will not return until data is received. With a non-blocking socket, if no data is available, the function will return -4.
For a connection-based socket (type _SO_TYPE_STREAM), the socket must first be connected by the soConnect or soAccept functions before this function can be called. For a connectionless socket (type _SO_TYPE_DGRAM), the socket must be bound to a local address with the soBind function before this function can be called.
Input: socket : SYSHANDLE Handle to the socket.
data : PTR Address of the buffer that contains the received data.
maxsize : DINT Maximum number of bytes that can be received (size of "data").
Output: size : DINT The number of bytes received.
Returns: INT
Declaration: FUNCTION soRecv : INT;
Example:
|