Google's Protocol Buffers in c#

前端 未结 1 830
感动是毒
感动是毒 2021-01-04 03:47

We are looking at using Google\'s Protocol Buffers to handle serialization between a c++ application and a c# application via networking.

My question is, I\'ve found

相关标签:
1条回答
  • 2021-01-04 04:27

    Sure; dotnet-protobufs is a port of the java version, so shares a very similar API and approach to the core google implementation; code-gem, immutability, etc.

    Protobuf-net is byte compatible, but is a complete from-scratch re-implementation, following standard .NET idioms - so is familiar to users of XmlSerializer etc. It also works against mutable objects (and immutable depending on the setup, and structs in v2), and has optional hooks for WCF, remoting, etc.

    Both can work from .proto (arguably dotnet-protobufs is better at this than protobuf-net); but protobuf-net can work against existing .net poco/DTO etc without .proto or any codegen.

    Additionally, protobuf-net offers things like inheritance support, but you might not choose to use that in your scenario as it doesn't map as easily to .proto definitions.

    0 讨论(0)
提交回复
热议问题