Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)
Applications using an inetd type of service to start servers can generally be ported to the OSS
environment with minimal changes. However, you can use the Guardian procedure
PROCESS_SPAWN_ to start OSS processes; see “Starting an OSS Server Process” (page 106).
Starting a Guardian Server Process
Typically, a client program is started by an application user at a terminal. A Guardian server can
be started by an operator or system manager, or by the Guardian LISTNER process, depending
on the way you design the server. When a client or server program is started, the person starting
the program might need to set one or more TCP/IP attributes to control how the program operates.
In the Guardian environment, you can use the LISTNER process to start a Guardian server such as
FTP or TELNET or a server that you develop. When the LISTNER process receives the notification,
it starts the server targeted by the request. The target server creates a socket using host-name and
source-port information, then accepts the pending connection request on the newly created socket.
Data is transferred between the NonStop target server and the remote client through the Guardian
socket until one or the other terminates the connection.
For more information on the LISTNER process, TCP/IP servers, and Guardian sockets, refer to one
of the following manuals:
• TCP/IP Configuration and Management Manual
• TCP/IPv6 Configuration and Management Manual
• TCP/IP (Parallel Library) Configuration and Management Manual
Additionally, the TCP/IP Programming Manual discusses starting TCP/IP servers.
The Guardian Programmer’s Guide contains information about queuing messages on $RECEIVE,
writing server programs, and communicating with Guardian processes. Further, refer to the
interprocess communication discussions in the Open System Services Programmer’s Guide for
information on Guardian and OSS processes communicating across processes, nodes, and within
one processor using $RECEIVE.
Starting an OSS Server Process
The Guardian LISTNER process cannot start servers in the OSS environment as it does in the
Guardian environment. However, you can use the LISTNER process to start a Guardian process
which in turn starts an OSS process with the Guardian procedure PROCESS_SPAWN_.
The process that calls PROCESS_SPAWN_ is a Guardian parent, regardless of whether it is an
OSS or Guardian process. The parent process reads system messages from $RECEIVE, which is
a special file through which a process receives system messages or messages from other processes.
OSS and Guardian processes can communicate between nodes, between processors, and within
the same processor through their $RECEIVE files.
Refer to the Open System Services Programmer’s Guide for a programming example of creating
an OSS process using PROCESS_SPAWN_; additionally, that guide has a programming example
of using $RECEIVE in an OSS server process.
If you plan to port programs activated by the inetd program from a UNIX environment to the
OSS environment, you will need to supply an interface program to communicate with the Guardian
LISTNER program.
106 OSS Porting Considerations