Home Forums Support Compression enabled on SendReceiveObject – how to disable

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
  • #1137


    We are currently testing this library and are running some performance tests against it.

    When using the SendReceiveObject in either of the following 2 statements it appears to be using compression on the data transfer streams. The reason we are looking into this is that performance for these types of transfers (40/sec) is getting crushed compared to regular SendObject calls (10,000 per sec). Doing performance analysis on it and it is spending 95% of its time in compression routines.


    Upon further investigation the client is not compressing it is on the return from the server that it is compressing. We are passing in the same connection options for both the send and receive. But looks like in the server side that the information is lost. Here are relevant code parts:


    SendReceiveOptions ProtoOnly = new SendReceiveOptions (DPSManager.GetDataSerializer<ProtobufSerializer>(),null,null );

    mst = server.SendReceiveObject<MsgSimpleText>(“SimpleIntReturnScenario”, “SimpleIntReturnType”, 2500, msi,ProtoOnly ,ProtoOnly );


    NetworkComms.AppendGlobalIncomingPacketHandler<MsgSimpleInt>(“SimpleIntReturnScenario”, HandleSimpleIntReturn);

    private static void HandleSimpleIntReturn(PacketHeader header, Connection connection, MsgSimpleInt msi)
    //Thread.Sleep(4000); // Test timeout situation.
    MsgSimpleText mst = new MsgSimpleText();
    mst.Text = “The value you sent was: ” + msi.Number.ToString();
    Console.WriteLine(“SimpleInt Value was: ” + msi.Number.ToString() + ” sending a SimpleText Object back”);
    connection.SendObject(“SimpleIntReturnType”, mst,connection.ConnectionDefaultSendReceiveOptions );

    I see the AppendGlobalIncomingPacketHandler allows for a server options object. But how does it get it from the client request?


    But, If I hard code the server side, I can get both sides to use non-compressed data transfers and the get the transactions/second into the thousands range. So I have a work around for this, but it seems that it should be able to bet set from the client and the server would adhere to it…


    The answer was easy. Once it was found!

    On the server side (and can do same on client side) you can access the static object – NetworkComms. It contains application wide settings and defaults. Not shown anywhere in tutorials or documentation, but it works. So:

    SendReceiveOptions nullCompressionSRO = new SendReceiveOptions(DPSManager.GetDataSerializer<ProtobufSerializer>(),null,null);

    NetworkComms.DefaultSendReceiveOptions = nullCompressionSRO;


    Glad you found a solution. The connection settings are only applied to the single connection endpoint, not both. This allows for more flexible configurations.


Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.