IiopWaitForReply Function

Action

Waits for a reply of a specific request. To enable waiting, an identification number has to be associated with the request. The identification number can be specified via an optional parameter of the IiopRequest function.

Include file

IIOP.bdh

Syntax

IiopWaitForReply( in hIiop : number,
                  in nId   : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object
nId

Identification number of the request to wait for. A reply from the specified request has to be received before the simulation continues

  • 0 Not allowed

  • IIOP_ALL_REPLIES Waits for all replies of the object

Example

dcltrans
  transaction TMain
  const
    ID_JIM := 1;
    // identification numbers
    ID_BOB := 2;
  var
    hBank, hJim, hBob: number;
  begin
    // retrieve handle to Bank/AccountManager
    ...
    // open an account for Jim
    IiopSetString(hBank, "Jim");
    IiopRequest(hBank, "open", IIOP_NON_BLOCKING, ID_JIM);
    // open an account for Bob
    IiopSetString(hBank, "Bob");
    IiopRequest(hBank, "open", IIOP_NON_BLOCKING, ID_BOB);
    // do anything else
    ...
    // wait until Jim's account has been opened
    IiopWaitForReply(hBank, ID_JIM);
    IiopGetObject(hBank, hJim);
    // wait until Bob's account has been opened
    IiopWaitForReply(hBank, ID_BOB);
    IiopGetObject(hBank, hBob);
    // release object
    IiopObjectRelease(hBank);
    IiopObjectRelease(hJim);
    IiopObjectRelease(hBob);
  end TMain;

Sample scripts

AsyncBank.bdf, SimpleAsyncBank.bdf, AsyncFact.bdf, AsyncOdb.bdf

You can find the sample script(s) here: <Public documents>\Silk Performer <version>\Samples\Corba