Download NS-ARPA/1000 User/Programmer Reference Manual
Transcript
GOTO 99;
END; {* terminate with usage *}
{}
{ The InitOption procedure uses the NetIPC call InitOpt to initialize the
}
{ option parameter used by the IPCCreate, IPCRecvcn, IPCRecv and IPCShutdown }
{ calls.
{}
InitOption(option);
{}
{ Set the socket kind to call socket for IPCCreate call and specify
{ TCP as the underlying transport protocol.
{}
socket_kind := CALL_SOCKET;
protocol_kind := TCP;
{}
{ The flags parameter is not used in this program so flags is
{ made type integer and assigned the value zero to ensure that all
{ the bits are clear.
{}
flags := ZERO;
{}
{ A CALL socket is created by calling IPCCreate. The value returned in
{ the call_socket_descriptor parameter will be used in the following
{ IPCConnect call to ipc1.
{}
IPCCREATE(socket_kind,protocol_kind,flags,option,call_socket_descriptor,result);
IF (result <> ZERO) THEN
BEGIN {* can’t create *}
call_name := ’IPCCREATE ’;
ReportError(call_name,result);
END; {* can’t create *}
writeln(screen,PROGNAME,’: a CALL socket has been created (IPCCreate).’);
{}
{ With the peer’s node name and socket name, we call IPCLookup to
{ to gain access to the peer’s call socket. If successful, a path
{ descriptor will be returned which we need for IPCConnect.
{ IPCLOOKUP searches the socket registry at the given node for our
{ peer’s name. This call returns a path_report_descriptor that is used in
{ the following IPCCONNECT call to request a connection with the peer.
{
{ Because it is possible for IPCLookupP to search for the socket name before
{ our peer places it in its node’s socket registry, we will try to look up the
{ name several times before aborting.}
{}
lookup_OK := FALSE;
bad_error := FALSE;
counter
:= ZERO;
-9('($$(((((% 8"