Compression property

You can compress messages exchanged between the .NET Open Client and the application server. The properties listed in the following table provide compression functionality to the .NET Open Client.

Table 1. Compression property
Property Description
CompressionEnabled()
Gets and sets PROGRESS.Session.TcpKeepAliveIntervalReturns TRUE if getCompressionEnabled() is called. The default value is FALSE,
CompressionLevel()
Gets and sets PROGRESS.Session.CompressionLevel
CompressionThreshold()
Gets and Sets PROGRESS.Session.CompressionThreshold

You can enable compression for the .NET Open Client using the following syntax:

using System.Collections.Generic;
using System.Linq;
using System.Text;
using Progress.Open4GL.Proxy;
using Progress.Open4GL.DynamicAPI;

namespace AppServerCompressionExample

{

    class Program

      {
        static void Main(string[] args)
          { Connection conn = new Connection(null, null, "http://host:portnumber/apsv");
            conn.CompressionEnabled = true;
            conn.CompressionLevel = 5;
            conn.CompressionThreshold = 256;

            OpenAppObject app = new OpenAppObject(conn, "testapp");

            ParameterSet pset = new ParameterSet(2);
            pset.setLongCharParameter(0, "longchar value",             ParameterSet.INPUT);
            pset.setLongCharParameter(1, "", ParameterSet.OUTPUT);
            app.runProcedure("echo.p", pset);

            String echoret = (String) pset.getOutputParameter(1);
            Console.WriteLine("Return : " + echoret);

            app.Dispose();
            conn.ReleaseConnection();
          }
        }
      }  

The following example uses the RunTimeProperties object code to illustrate that compression is enabled, compression level is set to 5, and the message size is set to 256 bytes.

Progress.Open4GL.RunTimeProperties.CompressionEnabled = true;

Progress.Open4GL.RunTimeProperties.CompressionLevel = 5;

Progress.Open4GL.RunTimeProperties.CompressionThreshold = 256;