|char * bufferPtr,|
tfRead() is used to receive messages from another socket. It is not called read to avoid confusion with an embedded kernel file system call. It operates identically to recv(), except that it does not have any flag parameter, and hence does not support out-of-band data, or overwriting the blocking state of the socket for the duration of the call.
- The socket descriptor to receive data from.
- The buffer to put the received data into.
- The length of the buffer area that bufferPtr points to.
- > 0
- The number of bytes actually received from the socket.
|Note:|| TM_SOCKET_ERROR means that this socket call has failed and the errorCode has been set on the socket itself.
To retrieve the socket error the user must call tfGetSocketError(socketDescriptor).
Possible socket errors
- The socket descriptor is invalid.
- Insufficient memory to complete the operation.
- The socket requires that the message be received atomically and bufferLength was too small.
- The socket is marked as non-blocking and no data is available to be read.
- The remote socket has closed the connection and there is no more data to be read (TCP socket only).
- The socket is not connected.
- One of the parameters is invalid.
- The TCP connection has timed out.