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

Table Of Contents
Chapter 4 163
NetIPC Examples
Example 4
writeln;
(* check X25_flag : 000000010000000000000000000000000 *)
optlen := 4;
readopt(opt,3,optioncode,optlen,x25_flags,result16);
if result16 <> 0 then
writeln('readdata failed (X25_flags) ', result16:1);
if (x25_flags[1] <> 1) and (x25_flags[2] <> 0) and
(x25_flags[3] <> 0) and (x25_flags[4] <> 0) then
writeln('error fast select flag should be set');
(************************ IPCCONTROL ***********************************)
(* set pass parameter for IPCCONTROL *)
initopt(wdata, 2, result16);
if result16 <> 0 then
writeln('initopt for ipccontrol failed');
(* send Call User Data back to calling node *)
for i := 1 to CUD_MAX do
cud[i] := CUD_MAX - i;
addopt(wdata, 0, 2,CUD_MAX, cud, result16);
if result16 <> 0 then
writeln('addopt for ipccontrol cud failed ',result16);
(* add special facility *)
sf[1] := hex('04');
sf[2] := hex('01');
addopt(wdata, 1, 145, 2, sf, result16);
if result16 <> 0 then
writeln('addopt for ipccontrol sf failed ',result16);
(* IPCCONTROL to accept the connection *)
writeln;
writeln('***** IPCCONTROL accept ');
ipccontrol( cd_local, 9, wdata,500, , , , result);
if result <> 0 then
writeln('ipccontrol failed ', result);
(****************** IPCRECV (2000 bytes) ******************************)
for i := 1 to 2000 do msg[i] := 0; (* initialize msg and dlen *)
dlen := 2000;
writeln;
writeln('***** IPCRECV (2000 bytes data) ');
ipcrecv ( cd_local, msg, dlen, , , result );
if result <> 0 then
writeln('IPCRECV 2000 failed ', result:1);
if dlen <> 2000 then
writeln('error data length = ',dlen:1);
(* Check that the correct data was received in the first vector *)
i := 1;
while i <= dlen do