t_rcvconnect(3)
NAME
t_rcvconnect − receive the confirmation from a connect request
SYNOPSIS
#include <xti.h> (for XTI)
or
#include <tiuser.h> (for TLI)
int t_rcvconnect (fd, call)
int fd;
struct t_call *call;
DESCRIPTION
This function enables a calling transport user to determine the status of a previously sent connect request and is used in conjunction with t_connect(3) to establish a connection in asynchronous mode. The connection will be established on successful completion of this function.
fd identifies the local transport endpoint where communication will be established, and call contains information associated with the newly established connection. call points to a t_call structure which contains the following members:
struct netbuf addr;
struct netbuf opt;
struct netbuf udata;
int sequence;
The type netbuf structure is defined in the <xti.h> or <tiuser.h> header file. This structure, which is used to define buffer parameters, has the following members:
unsigned int maxlen maximum byte length of the data buffer
unsigned int len actual byte length of data written to buffer
char *buf points to buffer location
In call, addr returns the protocol address associated with the responding transport endpoint. opt presents any protocol-specific information associated with the connection. For XTI over the OSI transport provider, struct isoco_options should be used. For TLI, see the documentation for the transport provider being used. udata points to optional user data that may be returned by the destination transport user during connection establishment. sequence has no meaning for this function.
The maxlen field of each argument must be set before issuing this function to indicate the maximum size of the buffer for each. However, call may be a null pointer, in which case no information is given to the user on return from t_rcvconnect. By default, t_rcvconnect executes in synchronous mode and waits for the connection to be established before returning. On return, the addr, opt, and udata fields reflect values associated with the connection.
If O_NONBLOCK or O_NDELAY is set (via t_open(3) or fcntl (2)), t_rcvconnect executes in asynchronous mode, and reduces to a poll for existing connect confirmations. If none are available, t_rcvconnect fails and returns immediately without waiting for the connection to be established. (See [TNODATA] below.) t_rcvconnect must be re-issued at a later time to complete the connection establishment phase and retrieve the information returned in call.
ERRORS
On failure, t_errno is set to one of the following:
[TBADF] The specified identifier does not refer to a transport endpoint.
[TBUFOVFLW] 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 call will be discarded. The provider’s state, as seen by the user, will be changed to T_DATAXFER.
[TNODATA] O_NONBLOCK or O_NDELAY was set, but a connect confirmation has not yet arrived.
[TLOOK] An asynchronous event has occurred on this transport endpoint and requires immediate attention.
[TNOTSUPPORT] This function is not supported by the underlying transport provider.
[TOUTSTATE] This function was issued in the wrong sequence on the transport endpoint referenced by fd.
[TSYSERR] A system error has occurred during execution of this function.
RETURN VALUE
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and t_errno is set to indicate the error.
FILES
For more information on data structures refer to /usr/include/xti.h and /usr/include/xti_iso.h for XTI, or /usr/include/tiuser.h for TLI.
NOTE
For portability purposes, it is recommended that O_NONBLOCK be used instead of O_NDELAY.
In HP-UX 9.0, XTI (X/Open Transport Interface) supports only OSI as a transport provider, and is available only as part of the OSI Transport Services 9000 product. Users of this product can access XTI versions of the t_* routines by linking with /usr/lib/libxti.a. For more information on XTI, see "HP-UX/9000 XTI Programmer’s Guide".
In HP-UX 9.0, TLI (Transport Layer Interface) supports any transport provider which is compliant with TPI (Transport Provider Interface). TLI is available only as part of the STREAMS product. Users of this product can access TLI versions of the t_* routines by linking with /usr/lib/libnsl_s.a. For more information on TLI, see the TLI section of "STREAMS/UX for HP 9000 Reference Manual".
SEE ALSO
fcntl(2), t_accept(3), t_alloc(3), t_bind(3), t_connect(3), t_listen(3), t_open(3).
Hewlett-Packard Company — HP-UX Release 9.0: October 1992