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

220 AppendixD
Migration From PTOP to NetIPC and RPM
Example: Client-Server Application
PSERVER: Sample PTOP Slave Program
Standard_level 'HP3000', uslinit$
program pserver( input, output }
{-------------------------------------------------------------------}
{ }
{ PURPOSE: }
{ The PCLIENT and PSERVER programs illustrate the use of the PTOP}
{ service for a simple name server application. See the PCLIENT }
{ program for details. }
{ }
{-------------------------------------------------------------------}
label 1; {for error exit }
const namelength = 20; {all lengths in bytes}
infolength = 60;
cce = 2; {condition code }
type shortint = -32768..32767;
msgtype = packed array[1..30] of char;
nametype = packed array[1..namelength] of char;
infotype = packed array[1..infolength] of char;
var name: nametype;
info: infotype;
func: shortint;
found: boolean;
function GET: shortint; intrinsic; {PTOP slave intrinsics}
procedure ACCEPT; intrinsic;
procedure REJECT; intrinsic;
function PCHECK: shortint; intrinsic;
procedure ERROR( msg: msgtype; errnum: shortint );
{----------------------------------------------------------------}
{ ERROR prints an error message and an associated PTOP error }
{ number. It terminates the program by going to the error exit. }
{----------------------------------------------------------------}
begin
writeln( 'Server: ', msg, 'PTOP error = ', errnum:3 );
goto 1;
end; {ERROR}
procedure FIND_NAME ( var reqname: nametype;
var info: infotype;
ar found: boolean );
{----------------------------------------------------------------}
{ FIND_NAME sequentially searches the data file for the requested}
{ name. It returns an indication of whether the name was found, }
{ and if it was found, the information field for the name. (In }
{ a real name server, a more efficient look up method would be }
{ used.) }
{----------------------------------------------------------------}
var filename: packed array[1..9] of char;
datafile: text;
name: nametype;