OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

Writing Your Program
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
5-29
Initiating Transfer-in of a Root Object
Parameters for GPI_MT_WAIT_ are:
session (input)
interval (input)
available (output)
session specifies the identifier of the session that is monitoring the input queue.
interval specifies the maximum interval of time (in 0.01-second units) that this
procedure is to wait for an unreserved root object to be located on the input queue. The
value can be as follows:
available indicates whether an unreserved root object has been detected, as follows:
OM-TRUE indicates a root object is available.
OM-FALSE indicates that no root objects are available at this time.
Sharing an Input Queue
Depending on your gateway implementation, multiple client processes might share the
same input queue. In such situations, each process might have a call to
GPI_MT_WAIT_ outstanding at the same time. In this case, each process receives an
indication when an unreserved root object is located. However, only one of the
processes can reserve that object by a subsequent call to
GPI_MT_START_TRANSFER_IN_ . Assuming no other unreserved root objects are
present, calls by other processes to GPI_MT_START_TRANSFER_IN_ fail.
This situation results in contention for unreserved root objects among client processes
sharing the queue. If your gateway implementation includes a shared input queue, client
programs should be designed to repeat the wait cycle following a failed attempt to
reserve a root object.
Example: Checking for an Inbound Root Object
The following TAL example shows a call to GPI_MT_WAIT_ .
Data declarations:
INT
status, -- STATUS code
session; -- ID of the session from which
-- the call is made
INT(32)
interval := 30000D, -- Interval for the wait (5 min.)
available; -- Indicates availability of an
-- unreserved inbound root object
= -1 Wait indefinitely for an unreserved object.
= 0 Return immediately even if an unreserved object is not present.
> 0 Wait for a maximum of the specified number of 0.01-second units for an
unreserved object.