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
(3C) andt_getinfo
(3C) 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
(3C) andt_snddis
(3C). Not all transport protocols can use this method. -
The buffers in the
t_call
structure used fort_listen
(3C) must be large enough to hold any data sent by the client during connection establishment. Use theT_ALL
argument tot_alloc
(3C) 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
(3C) on a client-side endpoint. The transport provider should assign an appropriate address to the transport endpoint. A server should retrieve its address fort_bind
(3C) 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. For more information about transport selection, see Transport Selection and Name-to-Address Mapping.
-
The reason codes associated with
t_rcvdis
(3C) are protocol-dependent. Do not interpret these reason codes if protocol independence is important. -
The
t_rcvuderr
(3C) 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. For more information about transport selection, see Transport Selection and Name-to-Address Mapping.
-
Do not use the optional orderly release facility of the connection mode service, provided by
t_sndrel
() andt_rcvrel
(), 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. For more information, see thet_sndrel
(3C) andt_rcvrel
(3C) man pages.