Socket_Recv - recv()
In: R0 = Socket descriptor
R1 = Pointer to buffer for received data
R2 = Size of buffer
R3 = Flags
Out: R0 = Amount of data received
This call reads as much data as possible from the specified socket, and returns it in the supplied buffer. If no data is available, the call will block until data is available, unless the socket has been marked non-blocking, in which case EWOULDBLOCK will be returned.
Various bits in the flags word can be set to affect how how the read is performed:
MSG_PEEK - Just peek at the data, leaving it in place to be read by a subsequent call.
MSG_OOB - Read any out-of-band data that is waiting on the socket, in place of the normal data.
MSG_DONTWAIT - Treat this particular call as non-blocking, ignoring the sockets normal blocking/non-blocking status.
MSG_WAITALL - Try and completely fill the supplied buffer, blocking for more data if necessary.
For stream sockets, this call may return zero as an indication that the other end has closed the connection.
|
|
|