|char * bufferPtr,|
|struct sockaddr * fromAddressPtr,|
|int * addressLengthPtr,|
|struct sockaddr * toAddressPtr,|
Take some data from the receive queue and give it to the user. Same as tfRecvFromTo(), but takes 3 extra parameters to let the user get the link layer source address of the packet and the interface the packet arrived on.
- The socket descriptor to use to receive the data.
- The buffer to store the received data.
- The length of the buffer to store the received data.
- MSG_DONTWAIT: Don't wait for the data
- 0: Wait for data to arrive.
- Where to store the address the data came from.
- Length of the area point to by fromAddressPtr or toAddressPtr.
- A pointer to the location to store the address the data was sent to.
- A pointer to the location to store the link layer address that the packet came from.
- A pointer to the length of the area pointed to by fromPhyAddrPtr. The length is updated to the length of the address copied.
- A pointer to the interface handle (as returned by tfAddInterface()) that the packet arrived on.
- >= 0
- The number of bytes actually sent on 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
- 'socketDescriptor' is not a valid descriptor.
- Insufficient memory to complete the operation.
- The message was too long.
- The TCP protocol requires usage of recv() not tfRecvFromToInterface().
- The socket is marked as non-blocking and the tfRecvFromToInterface() operation would block.