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

Table Of Contents
Chapter 4 167
NetIPC Examples
Example 4
net_name := 'direct';
(* add the option for NETWORK NAME *)
addopt (opt, 0, 140, 6, net_name, result16);
if result16 <> 0 then
writeln('ipccreate addopt failed', result16);
writeln;
writeln('##### IPCCREATE ');
ipccreate ( 3, X25, , opt, sd_remote, result );
if result <> 0 then
writeln ('ipccreate of remote socket failed', result);
(***************************** IPCDEST **********************************)
(* Get the destination descriptor to the local socket from the remote *)
(* socket. *)
(* We are calling the catch-all socket, so no address will be put in the*)
(* call, however we have the satisfy IPCDEST with something *)
adrs[1] := SOCK_ADDR div 256; (* first 8 bits of 32000 *)
adrs[2] := SOCK_ADDR mod 256; (* last 8 bits of 32000 *)
initopt ( opt, 1, result16 );
if result16 <> 0 then
writeln ('initopt for ipcdest failed');
(* add DEST_NET_ADDR opt to ipcdest *)
xchico[1] := 0; (* 0002 : protocol is X25 *)
xchico[2] := 0;
xchico[3] := 0;
xchico[4] := 2;
xchico[5] := 0; (* 0000 : address for the SVC *)
xchico[6] := 0;
xchico[7] := 0;
xchico[8] := 0;
xchico[9] := 5; (* 5 : length of X25 address *)
xchico[10] := 3; (* 30101: chico X25 address *)
xchico[11] := 0;
xchico[12] := 1;
xchico[13] := 0;
xchico[14] := 1;
(* add remote node X25 address *)
addopt(opt, 0, 16, 7, xchico, result16);
if result16 <> 0 then
writeln ('addopt for ipcdest failed',result16);
writeln;
writeln('##### IPCDEST ');
ipcdest ( 3, , , X25, adrs, 2, , opt, dd, result );
if result <> 0 then
writeln ('ipcdest failed ' , result );
(********************** IPCCONNECT *********************************)
initopt ( opt, 4, result16 );
if result16 <> 0 then
writeln ('initopt for ipcconnect failed',result16);