IiopSetBinary Function

Action

Associates a parameter containing binary data with a CORBA object. This function can be used to set parameters of a request in advance of calling the IiopRequest function.

Include file

IIOP.bdh

Syntax

IiopSetBinary( in hIiop      : number,
               in sBuffer    : string,
               in nBufferLen : number optional,
               in nAlign     : number optional): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object
sBuffer Buffer containing the binary data that will be associated with the CORBA object
nBufferLen

Number of binary data bytes that are associated with the CORBA object (optional). If specified, make sure to set

nDataLen <= size of sBuffer

nAlign

Binary data alignment (optional). Possible options are:

  • IIOP_ALIGN_2. Alignment to 2-byte boundaries

  • IIOP_ALIGN_4. Alignment to 4-byte boundaries

  • IIOP_ALIGN_8. Alignment to 8-byte boundaries

  • IIOP_ALIGN_16. Alignment to 16-byte boundaries

Default setting is alignment to 1-byte boundaries.

In addition, the byte order within the binary data can be specified:

  • IIOP_BIG_ENDIAN. Most significant byte is sent first

  • IIOP_LITTLE_ENDIAN. Least significant byte is sent first

Example

dcltrans
  transaction TSetBinary
  const
    HOST   := "192.168.20.21"; // server
    PORT   := 1052;            // port
    KEY    := "...\h00";       // key
    KEYLEN := 4;               // key length
  var
    hIiop : number; // handle to CORBA object
    sBuffer : string(512);
  begin
    IiopSetMaxGiopVersion("1.0");
    IiopSetByteOrder(IIOP_BIG_ENDIAN);

    // retrieve handle to server
    IiopObjectCreate(hIiop, "IDL:DemoObject:1.0", "1.2",HOST, PORT, KEY, KEYLEN);    
    // initialize buffer
    ...
    // pass parameter to request
    IiopSetBinary(hIiop, sBuffer, STRING_COMPLETE, IIOP_ALIGN_16 | IIOP_BIG_ENDIAN);
    // call request "Print" to print data
    IiopRequest(hIiop, "Print", IIOP_ONEWAY);
    IiopObjectRelease(hIiop);
  end TSetBinary;

Sample scripts

AnyDemo.bdf, Conf.bdf, DynAny.bdf

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