rt_recv
Description
The rt_recv function is used to receive data from a connected RTTP socket.
Syntax:
int rt_recv(RTEngine engine, RTSOCKET s, char * buffer, int len, int flag);
Parameters:
engine: The pointer to the RTTP engine instance returned by rt_init().
s: The connected RTTP socket descriptor.
buffer: A pointer to the buffer used to store the received data.
len: The maximum capacity of the buffer (in bytes).
flag: A reserved parameter; currently should be set to 0.
Return Value:
- When data is successfully read, it returns the number of actual bytes read.
- When the connection has been gracefully closed by the remote peer, it returns 0.
- When no data is currently available, it returns -1.
- In case of an error, it returns a negative error code.