Network Interface Guide

Connection Mode Routines

Each user must establish an identity with the transport provider. A transport address is associated with each transport endpoint. One user process can manage several transport endpoints. In connection mode service, one user requests a connection to another user by specifying the other's address. The structure of a transport address is defined by the transport provider. An address can be as simple as an unstructured character string (for example, file_server), or as complex as an encoded bit pattern that specifies all information needed to route data through a network. Each transport provider defines its own mechanism for identifying users. Addresses can be assigned to the endpoint of a transport by t_bind(3NSL).

In addition to t_open(3NSL) and t_bind(3NSL), several routines support local operations. Table 3-2 summarizes all local management routines of XTI/TLI.

Table 3-2 Routines of XTI/TLI for Operating on the Endpoint

Command 

Description 

t_alloc

Allocates XTI/TLI data structures 

t_bind

Binds a transport address to a transport endpoint 

t_close

Closes a transport endpoint 

t_error

Prints an XTI/TLI error message 

t_free

Frees structures allocated using t_alloc(3NSL)

t_getinfo

Returns a set of parameters associated with a particular transport provider 

t_getprotaddr

Returns the local and/or remote address associated with endpoint (XTI only) 

t_getstate

Returns the state of a transport endpoint 

t_look

Returns the current event on a transport endpoint 

t_open

Establishes a transport endpoint connected to a chosen transport provider 

t_optmgmt

Negotiates protocol-specific options with the transport provider 

t_sync

Synchronizes a transport endpoint with the transport provider 

t_unbind

Unbinds a transport address from a transport endpoint 

The connection phase lets two users create a connection, or virtual circuit, between them, as shown in Figure 3-3.

Figure 3-3 Transport Connection

Graphic

For example, the connection phase occurs when a server advertises its service to a group of clients, then blocks on t_listen(3NSL) to wait for a request. A client tries to connect to the server at the advertised address by a call to t_connect(3NSL). The connection request causes t_listen(3NSL) to return to the server, which can call t_accept(3NSL) to complete the connection.

Table 3-3 summarizes all routines available for establishing a transport connection. Refer to man pages for the specifications on these routines.

Table 3-3 Routines for Establishing a Transport Connection

Command 

Description 

t_accept

Accepts a request for a transport connection 

t_connect

Establishes a connection with the transport user at a specified destination 

t_listen

Listens for connect request from another transport user 

t_rcvconnect

Completes connection establishment if t_connect(3NSL) was called in asynchronous mode (see "Advanced Topics")

The data transfer phase lets users transfer data in both directions through the connection. t_snd(3NSL) sends and t_rcv(3NSL) receives data through the connection. It is assumed that all data sent by one user is guaranteed to be delivered to the other user in the order in which it was sent. Table 3-4 summarizes the connection mode data-transfer routines.

Table 3-4 Connection Mode Data Transfer Routines

Command 

Description 

t_rcv(3NSL)

Receives data that has arrived over a transport connection 

t_snd(3NSL)

Sends data over an established transport connection 

XTI/TLI has two types of connection release. The abortive release directs the transport provider to release the connection immediately. Any previously sent data that has not yet been transmitted to the other user can be discarded by the transport provider. t_snddis(3NSL) initiates the abortive disconnect. t_rcvdis(3NSL) receives the abortive disconnect. Transport providers usually support some form of abortive release procedure.

Some transport providers also support an orderly release that terminates communication without discarding data. t_sndrel(3NSL) and t_rcvrel(3NSL) perform this function. Table 3-5 summarizes the connection release routines. Refer to man pages for the specifications on these routines.

Table 3-5 Connection Release Routines

Command 

Description 

t_rcvdis(3NSL)

Returns a reason code for a disconnection and any remaining user data 

t_rcvrel(3NSL)

Acknowledges receipt of an orderly release of a connection request 

t_snddis(3NSL)

Aborts a connection or rejects a connect request 

t_sndrel(3NSL)

Requests the orderly release of a connection