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 227
Migration From PTOP to NetIPC and RPM
Example: Client-Server Application
loclength := 0;
while location[loclength+1] <> ' ' do
loclength := loclength + 1;
progname := 'RSERVER';
prognamelength := 7;
{-------------------------------------------------------------}
{ Set the dependent flag for the RPMCREATE. This causes the }
{ the server to terminate if the client terminates, or if the }
{ connection between them fails. }
{-------------------------------------------------------------}
for i := 0 to 31 do
rpmflags[i] := false;
rpmflags[dependent] := true;
{---------------------------------------}
{ Create the server on the remote node. }
{---------------------------------------}
RPMCREATE( progname, prognamelength,
location, loclength,
, , , ,
rpmflags, opt, progdesc, result );
if result <> 0 then
ERROR( 'Couldn't create server', result );
{-------------------------------------------------------------}
{ Once active, the server will create its own socket, look up }
{ the client's socket, and set up a vc connection between its }
{ socket and the client's socket. Wait here for the connect }
{ request from the server. }
{-------------------------------------------------------------}
IPCRECVCN( socketdesc, vcdesc, , , result );
if result <> 0 then
ERROR( 'Connect receive failed', result );
{-------------------------------------------------------------}
{ Now that the vc connection has been set up, the client's }
{ socket name and socket can be deleted. }
{-------------------------------------------------------------}
IPCNAMERASE( clientsockname, socketnamelength, result );
if result <> 0 then
ERROR( 'Couldn't delete socket name.', result );
IPCSHUTDOWN( socketdesc, , , result );
if result <> 0 then
ERROR( 'Couldn't shutdown socket.', result );
{-------------------------------------------------------------}
{ Each pass of this loop gets a name, sends it to the server, }
{ and receives an accept/reject indication from the server. }
{ If the server accepts the name, the client will receive the }
{ name information sent by the server. }
{-------------------------------------------------------------}
repeat
prompt('Client: Enter name (or EOT to exit):');
readln( name );
if name <> 'EOT' then
begin