HP 3000 Manuals

IPCLOOKUP [ Net IPC 3000/XL Programmer's Reference Manual ] MPE/iX 5.0 Documentation


Net IPC 3000/XL Programmer's Reference Manual

IPCLOOKUP 

Obtains a destination descriptor for a named call socket.  Use with TCP
access only.

Syntax 
_____________________________________________________________________________
|                                                                           |
|                                                                           |
|      IPCLOOKUP ( socketname, nlen[, location][, loclen][, flags], destdesc|
|                [, protocol][, socketkind][, result])                      |
|                                                                           |
_____________________________________________________________________________

Parameters 

 socketname (input) 

Character array, by reference.  The name of the socket.

 nlen (input) 

32-bit integer, by value.  The length in bytes of the specified socket
name.  Maximum is 16.

 location (input) 

Character array, by reference.  An environment ID or node name indicating
where the socket registry search is to take place.  The domain and
organization names which fully qualify the node/environment designation
are optional.  If no location is specified, the local socket registry is
searched.  This parameter can be a maximum of 50 characters long.

 loclen (input) 

32-bit integer, by value.  The length in bytes of the location parameter.
A zero value indicates that the socket registry search is to take place
on the local node.

 flags (input) 

32 bits, by reference.  A bit representation of various options.  The
only flag defined is:  flags [0].  It causes the destination descriptor
to be "protected." A protected destination descriptor is one which only
privileged users may create or use.

 destdesc (output) 

32-bit integer, by reference.  The returned destination descriptor, which
the calling process may use to access the named socket as a destination.
This descriptor is required by the IPCCONNECT intrinsic.

 protocol (output) 

32-bit integer, by reference.  A number identifying the protocol module
with which the socket is associated:  The only protocol available to user
processes is:  4 = TCP.

 socketkind (output) 

32-bit integer, by reference.  A number which identifies the socket's
type:  3 = call.

 result (output) 

32-bit integer, by reference.  The error code returned; zero if no error.

Description 

The IPCLOOKUP intrinsic is used to gain access to a named socket.  When
supplied with the socket's name, it returns a destination descriptor that
the calling process can use in order to connect to and send messages to
that socket.  It is important to synchronize the naming and lookup of
sockets so that the naming occurs before the lookup.  If these two events
are occurring concurrently, you can repeat the IPCLOOKUP call, checking
the result parameter after each call, until the call is successful.  If
the result value is 37 ("NAME NOT FOUND"), the socket has not yet been
given the name.  The following Pascal program fragment illustrates this
idea:

     socketname := 'RAINBOW';
     location := 'SOMEWHERE';
     result := 0;
     repeat
      IPCLOOKUP (socketname, 7, location, 9, ,
        destdesc, , , result);
     until result<>37;
     if result<>0 then ERRORPROCEDURE;

The only required parameters in the IPCLOOKUP intrinsic are  socketname,  
nlen, and  destdesc.  This intrinsic is option variable.  Condition codes
returned by this intrinsic are:

 *  CCE--Succeeded.

 *  CCL--Failed.

 *  CCG--Not returned by this intrinsic.

This intrinsic cannot be called in split stack mode.



MPE/iX 5.0 Documentation