Chapter Contents

Previous

Next
Porting UNIX Socket Applications to the SAS/C Environment

Integrated and Non-Integrated Sockets

Under the MVS/ESA 5.1 operating system, UNIX System Services (USS) supports integrated sockets. This feature provides a TCP/IP socket interface that is integrated with USS support instead of being an interface to TCP/IP software implemented only in the run-time library. When you use integrated sockets, an open socket has an USS file descriptor, which can be used like any other USS file descriptor. For instance, unlike a non-integrated socket, an integrated socket remains open in a child process created by fork , or in a program invoked by an exec function. Thus, when integrated sockets are used, a higher degree of UNIX compatibility is available than when non-integrated sockets are used.

You must decide whether your application is going to use integrated or non-integrated sockets. For example, an application that may run on a system that does not support USS should use non-integrated sockets. The setsockimp function specifies whether integrated or non-integrated sockets are being used. This function must be called before any other socket-related functions are called. By default, integrated sockets are used with exec -linkage applications, and non-integrated sockets are used otherwise.

A new environment variable, _SASC_SOCKIMP, has been added for SAS/C Release 7.00. _SASC_SOCKIMP uses the same values as the setsockimp function to determine which TCP/IP stack to load. However, _SASC_SOCKIMP allows the user, rather than the program developer, to decide at run time which TCP/IP stack to use. _SASC_SOCKIMP overrides any call to setsockimp as well as the default setting.

If you are running on OS/390 Version 2, Release 5 (or later), or your application uses exec-linkage, by default integrated sockets are used. If you are using an earlier version of OS/390, or a different operating system, non-integrated sockets are used by default.

Note: If setsockimp is called, and it is overridden with the environment variable, Note 463 is issued:

Socket implementation has been determined via Environment
Variable (%s).

Refer to Chapter 4, "SAS/C Environment Variables" in the SAS/C Library Reference, Volume 1for more information.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.