|
Description
The transport user can receive data over an established connection with the t_rcv() function.
The fd parameter identifies the local transport endpoint over which the data is received.
buf points to a receive buffer in which t_rcv() stores the incoming user data.
The user specifies the size of this receive buffer with nbytes.
The flags parameter is not supported.
By default, t_rcv() works in synchronous mode, i.e. t_rcv() waits for further data to arrive and blocks if no data is currently available.
However, if O_NDELAY or O_NONBLOCK was previously set with t_open() or the POSIX fcntl() function for the transport endpoint specified by fd, t_rcv() works in asynchronous mode and terminates with an error if no data is available. t_rcv() then returns the value -1 and sets t_errno to TNODATA.
Return value
After successful execution, t_rcv() returns the number of received bytes.
If an error occurs, -1 is returned and t_errno is set to indicate the error.
Errors
TBADF
The specified file descriptor does not reference a transport endpoint.
TLOOK
An asynchronous event occurred on the transport endpoint passed in fd and this must be processed immediately.
TNODATA
O_NDELAY or O_NONBLOCK was set but no data is currently available from the transport provider.
TNOTSUPPORT
This function is not supported by the underlying transport provider.
TOUTSTATE
The function was called in the wrong position within a sequence of XTI function calls for transport endpoint fd.
TSYSERR
A system error occurred during execution of this function.