Open System Services Programmer's Guide

“Using Shared Memory” (page 189)
“Using the $RECEIVE File” (page 191).
Guardian processes can use OSS sockets APIs, with the restrictions described in Table 20 (page 197).
The table includes a short description of the OSS sockets functions.
OSS and Guardian processes cannot communicate using message queues, because only OSS
processes can call the message queue functions. OSS and Guardian processes cannot use AF_UNIX
sockets through the Guardian sockets API because Guardian sockets do not support the AF_UNIX
address family.
Using Guardian AF_INET and AF_NET6 Sockets, and OSS AF_INET and AF_INET6
Sockets
OSS and Guardian processes can communicate within the same node and between nodes or
systems using either:
Guardian AF_INET or AF_INET6 sockets functions and semantics
or
OSS AF_INET or AF_INET6 sockets functions and semantics.
The AF_INET sockets functions use the services provided by NonStop TCP/IP; the AF_INET6
sockets functions use the services provided by NonStop TCP/IPv6. The two interfaces are similar,
but NonStop TCP/IPv6 allows a larger IP address, and hence, access to a greater number of
systems and devices.
The Guardian version of sockets was also derived from BSD sockets (Berkeley sockets) and provide
the general function of BSD sockets, but have modified APIs and behavior. Guardian sockets are
not POSIX-conformant and are less portable in code than OSS sockets, so converting a UNIX or
POSIX application to use Guardian sockets might require source or algorithm changes. The use of
Guardian sockets for NonStop TCP/IP, Parallel Library TCP/IP, and NonStop TCP/IPV6 is described
in the TCP/IP Programming Manual.
OSS processes can communicate with Guardian processes within the same node and between
nodes or systems through AF_INET or AF_INET6 sockets when either process uses the OSS sockets
functions.
The examples in the following subsections illustrate some of these uses.
Communication Using Only OSS APIs
Example 43 (page 179) and Example 44 (page 182) should give you an idea of how the OSS
AF_INET communication mechanism works and provide you with a template you can expand in
your applications.
Example 43 and Example 44 show an OSS server process and an OSS requester process using
OSS AF_INET functions to communicate.
NOTE: These examples use the AF_INET sockets functions, which provide an interface to NonStop
TCP/IP. The programs could also be written using the AF_INET6 sockets functions to interface to
NonStop TCP/IPv6. For information and examples of AF_INET6 sockets usage, refer to the TCP/IP
Programming Manual.
The server program in Example 43 is compiled as a linked program file named server2 that is
secured for execution in the current working directory. The requester program in Example 44 is
compiled as a linked program file named requester2 that is secured for execution in the current
working directory.
The server process can be started in the background from the OSS shell using the command:
run ./server2 &
Interprocess-Communication Interoperability 177