Skip Navigation Links | |
Exit Print View | |
Programming Interfaces Guide Oracle Solaris 11.1 Information Library |
2. Session Description Protocol API
8. Programming With XTI and TLI
Advanced XTI/TLI Programming Example
Asynchronous Connectionless-Mode Service
Making the Endpoint Asynchronous
Asynchronous Network Transfers
Asynchronous Connection-Mode Service
Asynchronously Establishing a Connection
Asynchronous Use of a Connection
Transferring a File Descriptor
Guidelines to Protocol Independence
XTI/TLI Versus Socket Interfaces
Additions to the XTI Interface
10. Transport Selection and Name-to-Address Mapping
11. Real-time Programming and Administration
Note - The interfaces described in this chapter are multithread safe. This means that applications containing XTI/TLI interface calls can be used freely in a multithreaded application. Because these interface calls are not re-entrant, they do not provide linear scalability.
Caution - The XTI/TLI interface behavior has not been well specified in an asynchronous environment. Do not use these interfaces from signal handler routines. |
TLI was introduced with AT&T System V, Release 3 in 1986. TLI provided a transport layer interface API. The ISO Transport Service Definition provided the model on which TLI is based. TLI provides an API between the OSI transport and session layers. TLI interfaces evolved further in AT&T System V, Release 4 version of UNIX and were also made available in SunOS 5.6 operating system interfaces.
XTI interfaces are an evolution of TLI interfaces and represent the future direction of this family of interfaces. Compatibility for applications using TLI interfaces is available. You do not need to port TLI applications to XTI immediately. New applications can use the XTI interfaces and you can port older applications to XTI when necessary.
TLI is implemented as a set of interface calls in a library (libnsl) to which the applications link. XTI applications are compiled using the c89 front end and must be linked with the xnet library (libxnet). For additional information on compiling with XTI, see the standards(5) man page.
Note - An application using the XTI interface uses the xti.h header file, whereas an application using the TLI interface includes the tiuser.h header file.
XTI/TLI code can be independent of current transport providers when used in conjunction with some additional interfaces and mechanisms described in Chapter 4. The SunOS 5 product includes some transport providers (TCP, for example) as part of the base operating system. A transport provider performs services, and the transport user requests the services. The transport user issues service requests to the transport provider. An example is a request to transfer data over a connection TCP and UDP.
XTI/TLI can also be used for transport-independent programming by taking advantage of two components:
Library routines that perform the transport services, in particular, transport selection and name-to-address translation. The network services library includes a set of interfaces that implement XTI/TLI for user processes. See Chapter 10, Transport Selection and Name-to-Address Mapping.
Programs using TLI should be linked with the libnsl network services library by specifying the -l nsl option at compile time.
Programs using XTI should be linked with the xnet library by specifying the -l xnet option at compile time.
State transition rules that define the sequence in which the transport routines can be invoked. For more information on state transition rules, see State Transitions. The state tables define the legal sequence of library calls based on the state and the handling of events. These events include user-generated library calls, as well as provider-generated event indications. XTI/TLI programmers should understand all state transitions before using the interface.