NetIPC 3000/XL Programmer's Reference Manual (5958-8600)
Table Of Contents
- 1 NetIPC Fundamentals
- 2 Cross-System NetIPC
- 3 NetIPC Intrinsics
- 4 NetIPC Examples
- A IPC Interpreter (IPCINT)
- B Cause and Diagnostic Codes
- C ErrorMessages
- D Migration From PTOP to NetIPC and RPM
- E C Program Language Considerations

Appendix D 223
Migration From PTOP to NetIPC and RPM
Example: Client-Server Application
RCLIENT: Sample NetIPC/RPM Master Program
$standard_level 'HP3000', uslinit$ program rclient( input, output );
{---------------------------------------------------------------------}
{ }
{ RCLIENT: Sample NetIPC/RPM Master Program }
{ }
{---------------------------------------------------------------------}
{ }
{ PURPOSE: }
{ The RCLIENT and RSERVER programs illustrate the use of the RPM }
{ and NetIPC services to implement a simple name server application. }
{ The user runs RCLIENT on his local node, and RCLIENT creates }
{ RSERVER on the node which contains the data. The user inputs }
{ names to RCLIENT, RCLIENT sends the names to RSERVER, }
{ RSERVER looks up the names in its name file and sends the associated}
{ info for the names back to RCLIENT. }
{ }
{ The RCLIENT and RSERVER programs are converted from the }
{ PCLIENT and PSERVER programs, which use PTOP to }
{ implement the name server. }
{ The PTOP-to-RPM/NetIPC conversion guidelines in the beginning }
{ of this appendix were used. }
{ }
{---------------------------------------------------------------------}
{ }
{ INTERACTION: }
{ The original PTOP implementation of the name server used a master- }
{ slave relationship between the client and server. The client }
{ sends requests, and the server can accept or reject the requests. }
{ This relationship is preserved in the NetIPC/RPM implementation. }
{ RCLIENT must first create RSERVER and they must set up a virtual }
{ circuit connection between them. RCLIENT creates and names a }
{ call socket. It then calls RPMCREATE to create RSERVER, passing }
{ the client's socket name and node name as RPM strings in the opt }
{ array. When it is created, RSERVER retrieves the client's socket }
{ and node name, creates its own socket, looks up the client's }
{ socket, and establishes a connection between its socket and the }
{ client's socket. At this point, the client and server are ready }
{ to exchange data. }
{ For each input name, RCLIENT sends the name to RSERVER. RSERVER }
{ looks up the name in its data file. If the name is found, RSERVER }
{ sends a one byte "accept" indication back to RCLIENT, followed by }
{ the name information. If the name is not found, RSERVER sends a }
{ "reject" indication to RCLIENT. This simulates the original use }
{ of ACCEPT and REJECT in the PTOP implementation. }
( RCLIENT RSERVER }
{ NSINFO for client node name }
{ IPCCREATE socket 1 }
{ IPCNAME socket 1, clientsock }
{ ADDOPT rpmstring, clientsock }
{ ADDOPT rpmstring, clientnode }
{ get server node name }