Open System Services Programmer's Guide
After you start the server process, the requester process in Example 44 can be started in the
foreground from the OSS shell using the command:
./requester2
Alternatively, both processes can be started in the foreground from separate terminal sessions. The
following sample dialog illustrates the processes run from two terminal sessions. The server terminal
session for the program in Example 43 appears as:
/home/software/chrisbl/cabpubs: ./server2
Server starting
Message received = hello
Message received = goodbye
Server stopping
/home/software/chrisbl/cabpubs:
while the requester terminal session for the program in Example 47 appears as:
/home/software/chrisbl/cabpubs: ./requester2
Requester starting
?hello
Read 6 bytes back from server
?goodbye
Read 8 bytes back from server
?
/home/software/chrisbl/cabpubs:
Note that the server2 program is an iterative server, performing its functions for multiple requestors
so that process-creation delays are minimized and processor usage is somewhat optimized. For
examples of more traditional dynamic and static server applications, refer to “Performance
Considerations” (page 195).
For more information about using OSS sockets, refer to the individual function reference pages
either online or in the Open System Services System Calls Reference Manual and the Open System
Services Library Calls Reference Manual.
178 Interprocess Communication