IiopSetAddressingMode Function

Action

Sets the default addressing mode or specifies an addressing mode for a particular object.

Include file

Iiop.bdh

Syntax

IiopSetAddressingMode( in hIiop : number,
                       in nMode : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object.
nMode

Addressing mode. Must be one of:

  • IIOP_ADDR_KEY. The target address is specified by the key. This is the default addressing mode.

  • IIOP_ADDR_PROFILE. The target address is specified by a profile (part of an IOR). This addressing mode is needed, for example, for traversing firewalls.

  • IIOP_ADDR_REFERENCE. The target address is specified by an IOR.

Example

dcltrans
  transaction TAddressingMode
  begin
    // general settings
    IiopSetMaxGiopVersion("1.2");
    IiopSetByteOrder(IIOP_BIG_ENDIAN);
    IiopSetAddressingMode(0, IIOP_ADDR_KEY); // set default addressing mode

    // retrieve handle to server
    IiopObjectCreate(hIiop, "IDL:DemoObject:1.0", "1.2", HOST, PORT, KEY, KEYLEN);
    IiopSetAddressingMode(hIiop, IIOP_ADDR_PROFILE); // set addressing mode for hIiop
     // the IIOP request message resulting from the following IiopRequest call
    // will contain a profile as target address information.
    IiopRequest(hIiop, "ARequest");
    IiopObjectRelease(hIiop);
  end TAddressingMode;