(TLI/XTI)
t_rcvudata(NET)
t_rcvudata --
receive a data unit
Syntax
TLI syntax
cc . . . -lnsl
#include <sys/tiuser.h>
int t_rcvudata (fd, unitdata, flags)
int fd;
struct t_unitdata *unitdata;
int *flags;
XTI syntax
cc . . . -lxti
#include <xti.h>
int t_rcvudata (fd, unitdata, flags)
int fd;
struct t_unitdata *unitdata;
int *flags;
Description
The t_rcvudata function is used in connectionless mode
to receive a data unit from another transport user.
fd identifies the local transport endpoint through which data is
received, unitdata
holds information associated with the received data unit, and
flags
is set on return to indicate that the complete data unit was not
received.
unitdata
points to a t_unitdata structure containing the following members:
struct netbuf addr; /* caller's address */
struct netbuf opt; /* options */
struct netbuf udata; /* user data returned by caller */
The maxlen
field of addr
, opt
, and
udata
must be set before issuing this function to indicate the maximum
size of the buffer for each.
On return from this call, addr
specifies the protocol address of the sending user,
opt
identifies protocol-specific options that were
associated with this data unit, and udata
specifies the user data that was received.
By default, t_rcvudata operates in synchronous mode and
waits for a data unit to arrive if none is currently available.
However, if O_NONBLOCK is set (via t_open or
fcntl), t_rcvudata executes in asynchronous mode and fails
if no data units are available.
If the buffer defined in the udata
field of unitdata
is not large enough to hold the current data unit,
the buffer is filled and T_MORE is set in flags
on return to indicate that another t_rcvudata
should be issued to retrieve the rest of the data unit.
Subsequent t_rcvudata
call(s) return zero for the length of the address and options
until the full data unit has been received.
Return values
t_rcvudata returns 0 on successful completion and -1 on failure,
and t_errno is set to indicate the error.
Diagnostics
On failure, t_errno may be set to one of the following:
[TBADF]-
The specified file descriptor does not refer to a transport endpoint.
[TBUFOVFLW]-
The number of bytes allocated for the incoming protocol address or
options is not sufficient to store the information.
The unit data information to be returned in unitdata is discarded.
[TLOOK]-
An asynchronous event has occurred on this transport endpoint and requires
immediate attention.
[TNODATA]-
O_NONBLOCK was set, but
no data units are currently available from the transport provider.
[TNOTSUPPORT]-
The T_CLTS service type is not supported by the
underlying transport provider.
[TOUTSTATE]-
The state should have been
T_IDLE when this routine was called; XTI only.
[TSYSERR]-
A system error occurred during execution of this function.
One possibility, indicated by errno set to
EPROTO, is a protocol error.
See also
Intro(NET),
netbuf(FP),
t_rcvuderr(NET),
t_sndudata(NET)
Standards conformance
t_rcvudata is conformant with:
AT&T SVID Issue 3
;
X/Open CAE Specification, Networking Services, Issue 4, 1994.
;
and
Intel386 Binary Compatibility Specification, Edition 2 (iBCSe2)
.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003