[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Communications Technical Reference, Volume 2

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

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:

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.

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The t_accept subroutine, t_alloc subroutine, t_bind subroutine, t_connect subroutine, t_listen subroutine, t_look subroutine, t_open subroutine.

List of Streams Programming References and STREAMS Overview in AIX Version 4.3 Communications Programming Concepts.


[ Previous | Next | Contents | Glossary | Home | Search ]