|
|
This section provides an introduction to the issues involved in porting a sockets application to XTI and includes notes on the differences between BSD sockets and UnixWare sockets that programmers must be aware of. Although existing sockets applications can be rewritten for XTI relatively easily, such ports are not necessary for sockets applications that are to run only over TCP/IP or UDP/IP networks. However, XTI is the preferred programming interface for accessing transport services and it is recommended that programmers writing new applications for UnixWare use XTI.
Both XTI and sockets routines are defined in terms of communications paths identified by file descriptors. These file descriptors are known as ``transport endpoints'' for XTI and as ``sockets'' for the socket interface. In most cases, there are parallel routines for each transport function. For example, the XTI routine t_open returns a file descriptor that identifies a transport endpoint; the routine socket returns a file descriptor that identifies a socket. ``Table of XTI/Sockets equivalents'' shows the parallels among XTI and sockets interface routines.
This section will highlight the areas in which there is no direct correspondence between XTI and sockets routines. The examples will first show code that uses the socket interface and then show how to rewrite the program using XTI.
``Moving sockets applications to UnixWare 7 Release 7.2'' documents differences between UnixWare sockets and BSD sockets. Programmers must be aware of these differences before moving BSD sockets applications to UnixWare.
UnixWare socket calls are implemented as library routines.
Application programs that use sockets should be compiled and
linked with socket libraries:
cc prog.c -dy -lsocket -lnsl