'\"macro stdmacro
.if n .pH g3n.t_rcvconnect @(#)t_rcvconnect	40.6 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} t_rcvconnect 3N "Networking Support Utilities" "\&"
.if \nX=1 .ds x} t_rcvconnect 3N "Networking Support Utilities"
.if \nX=2 .ds x} t_rcvconnect 3N "" "\&"
.if \nX=3 .ds x} t_rcvconnect "" "" "\&"
.if \nX=4 .ds x} t_rcvconnect "NS_LIB" "EXTENSION" " "
.TH \*(x}
.SH NAME
\f4t_rcvconnect\f1 \- receive the confirmation from a connect request
.SH SYNOPSIS
\f4#include <tiuser.h>\f1
.PP
\f4int t_rcvconnect (int fd, struct t_call \(**call);\f1
.SH DESCRIPTION
This function enables a calling transport user to determine
the status of a previously sent connect request
and is used in conjunction with
\f4t_connect\fP
to establish a connection in asynchronous mode.
The connection will be established on successful completion of
this function.
.PP
\f4fd\f1
identifies the local transport endpoint where communication will be
established,
and
\f4call\f1
contains information associated with the newly established connection.
\f4call\fP
points to a \f4t_call\f1 structure which contains the following members:
.PP
.RS
.ft4
struct netbuf addr;
.br
struct netbuf opt;
.br
struct netbuf udata;
.br
int sequence;
.ftP
.RE
.PP
\f4netbuf\f1 is described in \f4intro\fP(3).
In
\f4call\fP,
\f4addr\fP
returns the protocol address associated with the responding
transport endpoint,
\f4opt\fP
presents any protocol-specific information associated with the connection,
\f4udata\fP
points to optional user data that may be returned by
the destination transport user during connection establishment,
and
\f4sequence\fP
has no meaning for this function.
.PP
The
\f4maxlen\fP
[see \f4netbuf\f1 in \f4intro\fP(3)] field of each argument
must be set before issuing this function to indicate the maximum
size of the buffer for each.
However,
\f4call\fP
may be \s-1NULL\s+1, in which case no information is given to
the user on return from
\f4t_rcvconnect\fP.
By default,
\f4t_rcvconnect\fP
executes in synchronous mode and
waits for the connection to be established before returning.
On return, the
\f4addr\fP,
\f4opt\fP,
and
\f4udata\fP
fields reflect values associated with the connection.
.PP
If
\f4O_NDELAY\fP
or
\f4O_NONBLOCK\fP
is set (via
\f4t_open\fP
or
\f4fcntl\fP),
\f4t_rcvconnect\fP
executes in asynchronous mode, and
reduces to a poll for existing connect confirmations.
If none are available, \f4t_rcvconnect\fP fails and returns immediately
without waiting for the connection to be established.
(See \f4TNODATA\fP below.)
\f4t_rcvconnect\fP
must be re-issued
at a later time to complete the connection establishment phase and
retrieve the information returned in
\f4call\fP.
.P
On failure, \f4t_errno\f1 may be set to one of the following:
.TP 20
\f4[TBADF]\fP
The specified file descriptor does not refer to a transport endpoint.
.TP
\f4[TBUFOVFLW]\fP
The number of bytes allocated for an incoming argument is not
sufficient to store the value of that argument
and the connect information to be returned in
\f4call\fP
will be discarded.
The provider's state, as seen by the user, will be changed
to \f4DATAXFER\fP.
.TP
\f4[TNODATA]\fP
\f4O_NDELAY\fP or \f4O_NONBLOCK\fP
was set, but a connect confirmation has not yet arrived.
.TP
\f4[TLOOK]\fP
An asynchronous event has occurred on this transport connection and requires
immediate attention.
.TP
\f4[TNOTSUPPORT]\fP
This function is not supported by the underlying transport
provider.
.TP
\f4[TSYSERR]\fP
A system error has occurred during execution of this function.
.SH SEE ALSO
.na
\f4intro\fP(3), \f4t_accept\fP(3N),
\f4t_bind\fP(3N),
\f4t_connect\fP(3N),
\f4t_listen\fP(3N),
\f4t_open\fP(3N).
.sp .2
\f2UNIX System V Network Programmer's Guide\f1.
.ad
.SH DIAGNOSTICS
\f4t_rcvconnect\fP
returns 0 on success and \-1 on failure and
\f4t_errno\f1 is set to indicate the error.
.Ee
