IiopSetMaxChunkSize Function

Action

Sets the maximum size of value type chunks. Chunked encoding may be used with value types only.

Include file

Iiop.bdh

Syntax

IiopSetMaxChunkSize( in nSize : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
nSize Maximum size of a chunk used for chunked value state encoding.

Example

dcltrans
  transaction TMaxChunkSize
  const
   HOST           := "192.168.20.21"; // server
    PORT           := 1052;           // port
    KEY            := "...\h00";      // key
    KEYLEN         := 4;              // key length
  var
    sBuf   : string(1024);
    nUsed  : number;
  begin
    // general settings
    IiopSetMaxGiopVersion("1.2");
    IiopSetByteOrder(IIOP_BIG_ENDIAN);
    IiopSetMaxChunkSize(2096); // set maximum chunk size

     // retrieve handle to server
    IiopObjectCreate(hIiop, "IDL:DemoObject:1.0", "1.2", HOST, PORT, KEY, KEYLEN);

     // set value
    IiopSetValue(hIiop, REP_ID);
    IiopSetLong(hIiop, 5);
    IiopEndValue(hIiop);

     // set another value
    IiopSetValue(hIiop, REP_ID_LIST, CODE_BASE, TRUE);  // value is being chunked encoded

    for i := 1 to 10000
      IiopSetLong(hIiop, i);
      IiopSetBoolean(hIiop, TRUE);
      IiopSetString(hIiop, "This is a string");
    end;

     IiopEndValue(hIiop);

     // call request "SetValue"
    // the IIOP request message resulting from the following IiopRequest call
    // contains a value whose state members are chunked into several 2096 byte chunks.
    IiopRequest(hIiop, "SetValue");
    IiopObjectRelease(hIiop);
  end TMaxChunkSize;