t_listen - listen for a connect request
int t_listen(fd, call)
struct t_call *call;
t_listen() listens for a connect request from a calling transport user.
fd identifies the local transport endpoint where connect indications
arrive, and on return, call contains information describing the connect
indication. call points to a t_call() structure which contains the
struct netbuf addr;
struct netbuf opt;
struct netbuf udata;
The maxlen, len, and buf members of the netbuf structure are described
in t_accept(3N). In call, addr returns the protocol address of the
calling transport user, opt returns protocol-specific parameters asso-
ciated with the connect request, udata returns any user data sent by
the caller on the connect request, and sequence is a number that
uniquely identifies the returned connect indication. The value of
sequence enables the user to listen for multiple connect indications
before responding to any of them.
Since this function returns values for the addr, opt, and udata fields
of call, the maxlen field of each must be set before issuing the t_lis-
ten() to indicate the maximum size of the buffer for each.
By default, t_listen() executes in synchronous mode and waits for a
connect indication to arrive before returning to the user. However, if
T_NDELAY is set (using t_open(3N) or fcntl()), t_listen() executes
asynchronously, reducing to a poll(2) for existing connect indications.
If none are available, it returns -1 and sets t_errno to TNODATA.
0 on success.
-1 on failure and sets t_errno to indicate the error.
TBADF The specified file descriptor does not refer to a
TBUFOVFLW The number of bytes allocated for an incoming argu-
ment is not sufficient to store the value of that
argument. The provider's state, as seen by the
user, changes to T_INCON and the connect indication
information to be returned in call is discarded.
TLOOK An asynchronous event has occurred on this trans-
port endpoint and requires immediate attention.
TNODATA T_NDELAY was set, but no connect indications had
TNOTSUPPORT This function is not supported by the underlying
TSYSERR The function failed due to a system error and set
errno to indicate the error.
intro(3), t_accept(3N), t_bind(3N), t_connect(3N), t_open(3N), t_rcv-
21 January 1990 T_LISTEN(3N)