Home Help Center

C# and Protobuf

raycrayraycray Member Ray ChengProject: Electronic Trading
Hi team,

I am currently using protobuf with C++ base on the information from ZerocLab. I would like to add clients running on c# .NET communicate with C++ servers, base on the same protobuf.

As far as I understand I may reuse the same slice file and handle the message as raw buffer in C#. But it would be really nice I can have similar mechanism in the c# side as well.

Is it possible to build/wrap a similar streamhelper thing in c# side?

Raymond

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Raymond,

    It's currently not possible to setup helpers with Ice for C# to transparently serialize/de-serialize operation parameters with Protobuf. You will have to implement some wrappers manually to do this yourself. We will consider making this possible with Ice for C#.

    Btw, which protobuf C# implementation do you use?

    Cheers,
    Benoit.
  • raycrayraycray Member Ray ChengProject: Electronic Trading
    Hi Benoit,

    I plan to use protobuf-net on c# side for my project. actually my project will involve c# GUI and c++ server components. Will use ICE and ICEStorm for transportation and protobuf for messaging protocol.

    Rgds,
    Raycray
    benoit wrote: »
    Hi Raymond,

    It's currently not possible to setup helpers with Ice for C# to transparently serialize/de-serialize operation parameters with Protobuf. You will have to implement some wrappers manually to do this yourself. We will consider making this possible with Ice for C#.

    Btw, which protobuf C# implementation do you use?

    Cheers,
    Benoit.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Ok thanks for the information. Just out of curiosity, why did you choose to use protobuf instead of Slice types and the Ice encoding?

    Cheers,
    Benoit.
  • raycrayraycray Member Ray ChengProject: Electronic Trading
    Hi Benoit,

    I did some benchmark about ICE vs protobuf messaging codec, I found protobuf give slightly higher throughput (with higher CPU usage as well). That's why I decided to use protobuf as messaging protocol.

    Raymond
Sign In or Register to comment.