Archived

This forum has been archived. Please start a new discussion on GitHub.

C# and Protobuf

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

  • benoit
    benoit Rennes, France
    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.
  • 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.
  • benoit
    benoit Rennes, France
    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.
  • 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