t_rcvconnect Subroutine for Transport Layer Interface

Purpose

Receives the confirmation from a connect request.

Library

Transport Layer Interface Library (libtli.a)

Syntax

#include <tiuser.h>

int t_rcvconnect(fd, call)
int  fd;
struct t_call * call;

Description

The t_rcvconnect subroutine enables a calling transport user to determine the status of a previously sent connect request and is used in conjunction with t_connect to establish a connection in asynchronous mode. The connection will be established on successful completion of this function.

Parameters

Item Description
fd Identifies the local transport end point where communication will be established.
call Contains information associated with the newly established connection.

The call parameter points to a t_call structure that contains the following elements:

struct netbuf addr;
struct netbuf opt;
struct netbuf udata;
int sequence;

The netbuf structure contains the following elements:

addr
Returns the protocol address associated with the responding transport end point.
opt
Presents protocol-specific information associated with the connection.
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 parameter must be set before issuing this function to indicate the maximum size of the buffer for each. However, the call parameter may be null, in which case no information is given to the user on return from the t_rcvconnect subroutine. By default, the t_rcvconnect subroutine runs 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 the O_NDELAY flag is set (using the t_open subroutine or fcntl command), the t_rcvconnect subroutine runs in asynchronous mode and reduces to a poll for existing connect confirmations. If none are available, the t_rcvconnect subroutine stops and returns immediately without waiting for the connection to be established. The t_rcvconnect subroutine must be re-issued at a later time to complete the connection establishment phase and retrieve the information returned in the call parameter.

Return Values

On successful completion, the t_rcvconnect subroutine returns a value of 0. Otherwise, it returns a value of -1 and sets the t_errno variable to indicate the error.

Error Codes

If unsuccessful, the t_errno variable may be set to one of the following:

Value Description
TBADF The specified file descriptor does not refer to a transport end point.
TBUFOVFLW The number of bytes allocated for an incoming parameter is not sufficient to store the value of that parameter and the connect information to be returned in the call parameter will be discarded. The state of the provider, as seen by the user, will be changed to DATAXFER.
TLOOK An asynchronous event has occurred on this transport connection and requires immediate attention.
TNODATA The O_NDELAY flag was set, but a connect confirmation has not yet arrived.
TNOTSUPPORT This subroutine is not supported by the underlying transport provider.
TOUTSTATE This subroutine was issued in the wrong sequence.
TSYSERR A system error has occurred during operation of this subroutine.