The following table shows connection establishment/connection release/data transfer in connection mode.
Table 7-6 Connection Mode State--Part 2
Event/State | T_OUTREL | T_INREL | T_UNBND |
---|---|---|---|
connect1 |
|
|
|
connect2 |
|
|
|
rcvconnect |
|
|
|
listen |
|
|
|
accept1 |
|
|
|
accept2 |
|
|
|
accept3 |
|
|
|
snd |
| T_INREL |
|
rcv | T_OUTREL |
|
|
snddis1 | T_IDLE | T_IDLE |
|
snddis2 |
|
|
|
rcvdis1 | T_IDLE | T_IDLE |
|
rcvdis2 |
|
|
|
rcvdis3 |
|
|
|
sndrel |
| T_IDLE |
|
rcvrel | T_IDLE |
|
|
pass_conn |
|
| |
optmgmt | T_OUTREL | T_INREL | T_UNBND |
closed | T_UNINIT | T_UNINIT |
|
The following table shows
Table 7-7 Connectionless Mode State
Event/State | T_IDLE |
---|---|
snudata | T_IDLE |
rcvdata | T_IDLE |
rcvuderr | T_IDLE |
Guidelines to Protocol Independence
The set of XTI/TLI services, common to many transport protocols, offers protocol independence to applications. Not all transport protocols support all XTI/TLI services. If software must run in a variety of protocol environments, use only the common services.
The following is a list of services that might not be common to all transport protocols.
In connection mode service, a transport service data unit (TSDU) might not be supported by all transport providers. Make no assumptions about preserving logical data boundaries across a connection.
Protocol and implementation-specific service limits are returned by the t_open(3NSL) and t_getinfo(3NSL) routines. Use these limits to allocate buffers to store protocol-specific transport addresses and options.
Do not send user data with connect requests or disconnect requests, such as t_connect(3NSL) and t_snddis(3NSL). Not all transport protocols can use this method.
The buffers in the t_call structure used for t_listen(3NSL) must be large enough to hold any data sent by the client during connection establishment. Use the T_ALL argument to t_alloc(3NSL) to set maximum buffer sizes to store the address, options, and user data for the current transport provider.
Do not specify a protocol address on t_bind(3NSL) on a client-side endpoint. The transport provider should assign an appropriate address to the transport endpoint. A server should retrieve its address for t_bind(3NSL) in a way that does not require knowledge of the transport provider's name space.
Do not make assumptions about formats of transport addresses. Transport addresses should not be constants in a program. Chapter 8, Transport Selection and Name-to-Address Mapping contains detailed information about transport selection.
The reason codes associated with t_rcvdis(3NSL) are protocol-dependent. Do not interpret these reason codes if protocol independence is important.
The t_rcvuderr(3NSL) error codes are protocol dependent. Do not interpret these error codes if protocol independence is a concern.
Do not code the names of devices into programs. The device node identifies a particular transport provider and is not protocol independent. See Chapter 8, Transport Selection and Name-to-Address Mapping for details regarding transport selection.
Do not use the optional orderly release facility of the connection mode service, provided by t_sndrel(3NSL) and t_rcvrel(3NSL), in programs targeted for multiple protocol environments. This facility is not supported by all connection-based transport protocols. Using the facility can prevent programs from successfully communicating with open systems.
XTI/TLI Versus Socket Interfaces
XTI/TLI and sockets are different methods of handling the same tasks. Although they provide mechanisms and services that are functionally similar, they do not provide one-to-one compatibility of routines or low-level services. Observe the similarities and differences between the XTI/TLI and socket-based interfaces before you decide to port an application.
The following issues are related to transport independence, and can have some bearing on RPC applications:
Privileged ports - Privileged ports are an artifact of the Berkeley Software Distribution (BSD) implementation of the TCP/IP Internet Protocols. These ports are not portable. The notion of privileged ports is not supported in the transport-independent environment.
Opaque addresses - Separating the portion of an address that names a host from the portion of an address that names the service at that host cannot be done in a transport-independent fashion. Be sure to change any code that assumes it can discern the host address of a network service.
Broadcast - No transport-independent form of broadcast address exists.
Socket-to-XTI/TLI Equivalents
The following table shows approximate equivalents between XTI/TLI interfaces and socket interfaces. The comment field describes the differences. If the comment column is blank, either the interfaces are similar or no equivalent interface exists in either interface.
Table 7-8 TLI and Socket Equivalent Functions