NetIPC 3000/XL Programmer's Reference Manual (5958-8600)

Table Of Contents
Chapter 4 145
NetIPC Examples
Example 2
flags: flags_type; { flags parameter }
result: integer; { back from IPC call }
result16: shortint; { back from opt calls }
i: integer; { loop counter for messages }
messag1: msg_type; { for printed messages }
messag2: msg_type; { for printed messages }
expect : msg_type; { expected message }
vd: netipc_data_desc; { vectored data desc }
error: boolean; { set if an error occurred }
location: location_type; { other programs location node }
adrs: packed array [0..1] of byte; { socket's address }
opt: packed array [0..31] of byte; { options array }
{ IPC intrinsics used }
procedure addopt; intrinsic;
procedure initopt; intrinsic;
procedure ipccheck; intrinsic;
procedure ipcconnect; intrinsic;
procedure ipccontrol; intrinsic;
procedure ipccreate; intrinsic;
procedure ipcdest; intrinsic;
procedure ipcerrmsg; intrinsic;
procedure ipcget; intrinsic;
procedure ipcgive; intrinsic;
procedure ipcrecv; intrinsic;
procedure ipcrecvcn; intrinsic;
procedure ipcsend; intrinsic;
procedure ipcshutdown; intrinsic;
begin
$if 'native_mode'$
writeln
('example program vector2 to show vectored data operation in Native Mode');
$else$
writeln
('example program vector2 to show vectored data operation in
Compatibility Mode');
$endif$
{ create the remote socket normally }
ipccreate ( 3, 4, , , sd_remote, result );
if result <> 0 then
writeln ('ipccreate of remote socket failed');
{ Get the destination descriptor to the local socket from the remote }
{ socket. Notice that the remote must know the address of the local }
{ socket. This arrangement must be made beforehand. }
{ specify the address of the local socket }
adrs[0] := SOCK_ADDR div 256; { first 8 bits of 32000 }
adrs[1] := SOCK_ADDR mod 256; { last 8 bits of 32000 }