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

Chapter 4 157
NetIPC Examples
Example 3
PROCEDURE echo;
var
opt : opt_type;
calling_address : packed array [1..16] of nibble;
i,
option_code,
addr_len,
data_len : shint;
buffer : buffer_type;
buffer_len : integer;
begin {echo}
{------------------------------------}
{ Initialize an option field to get }
{ the calling node address. }
{------------------------------------}
Initopt (opt,1);
Addopt (opt,0,c_calling_add_code,8,calling_address,r);
{------------------------------------}
{ Wait for a connection request. }
{ ie Incoming CALL. }
{------------------------------------}
IPCRecvcn (p_call_desc,p_vc_desc,,opt,result);
if result = 0 then
begin
writeln('Call Received.........');
{------------------------------------}
{ Get the calling address from the }
{ CALL pkt. }
{------------------------------------}
data_len := 8;
option_code := c_calling_add_code;
Readopt (opt,0,option_code,data_len,calling_address,r);
writeln ('Calling node address = ');
addr_len := calling_address [1]; {the first nibble contains the addr
len}
for i:= 2 to addr_len+1 do write (calling_address [i]:1);
writeln ;
{------------------------------------}
{ Loop on data transfer. }
{------------------------------------}
i:= 1;
while (i <= c_nb_loop) and (result = 0) do
begin
buffer_len := c_buffer_len;
{------------------------------------}
{ Receive pkt from X25CHECK. }
{------------------------------------}
IPCRecv (p_vc_desc,buffer,buffer_len,,,result);
if result = 0 then
begin
writeln('Data packet received..........');