如何实现Java客户端交谈使用protobuf网v2中的.NET服务器上的协议缓冲区(德)序列化?缓冲区、如何实现、客户端、器上

由网友(像极了爱情)分享简介:如果我理解正确的话,在Java端需要相应的.proto文件。不过,目前还不清楚我如何产生一个从服务器端使用的RuntimeTypeModel实例(protobuf网V2)。If I understand it correctly, the Java end needs the respective .proto fi...

如果我理解正确的话,在Java端需要相应的.proto文件。不过,目前还不清楚我如何产生一个从服务器端使用的RuntimeTypeModel实例(protobuf网V2)。

If I understand it correctly, the Java end needs the respective .proto file. However, it is unclear to me how to generate one from the RuntimeTypeModel instance (protobuf-net v2) used on the server side.

感谢。

推荐答案

在目前,它根本没有被改写;还有就是 GetProto(),但它并不适用于V2作为它需要大量重构从 RuntimeTypeModel 。很简单,就是找时间把code一起的情况。

At current, it simply hasn't been re-written; there is a v1 version of GetProto(), however it won't apply to v2 as it needs to be heavily refactored to work from RuntimeTypeModel. It is simply a case of finding time to put the code together.

如果该模型是中等大小的,我也许可以帮忙一起手动挂钩吧。

If the model is moderately sized, I can probably help hook it together manually.

另请注意,protobuf网提供了一些功能的不会的地图非常漂亮到.proto,因为它们在所有的核心.proto没有定义的(它们是通常都有明确记录为扩展名),如:

Note also that protobuf-net offers some features that will not map very nicely into .proto, since they have no definition at all in core .proto (these are usually clearly documented as extension), such as:

引用跟踪 继承 动态类型

此外,某些BCL核心类型的没有直接.proto同行,包括:

Additionally, some of the BCL core types do not have direct .proto counterparts, including:

的Guid 日期时间 在时间跨度

这些的可除preTED 的,但需要更多的洗牌

these can be interpreted, but require a little more shuffling