#include <tiuser.h>
int t_rcvudata(fd, unitdata, flags) int fd; struct t_unitdata *unitdata; int *flags;
t_rcvudata() is used in connectionless mode to receive a data unit from another transport user. fd identifies the local transport endpoint through which data will be 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 defined in <nettli/tiuser.h> as:
struct t_unitdata { struct netbuf addr; /* address */ struct netbuf opt; /* options */ struct netbuf udata; /* user data */ };
The maxlen, len, and buf members of the netbuf structure are described in t_accept.3n The maxlen field of addr, opt, and udata must be set before issuing t_rcvudata() 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 will wait for a data unit to arrive if none is currently available. However, if O_NDELAY is set (using t_open.3n or fcntl()), t_rcvudata() will execute in asynchronous mode and will fail 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 will be filled and T_MORE will be 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) will return zero for the length of the address and options until the full data unit has been received.
t_rcvudata() returns:
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97