- 浏览: 399566 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (309)
- xaml C# wpf (0)
- scala java inner clas (1)
- Tools UML Eclipse UML2 (1)
- Timer .NET Framework (1)
- perl (6)
- python function paramter (1)
- Python Docstring (1)
- Python how to compare types (1)
- Python (8)
- java (5)
- C# (76)
- C# WPF (0)
- p4 (0)
- WPF (46)
- .net (6)
- xaml (1)
- javascript (40)
- windows (10)
- scala (4)
- winform (1)
- c++ (48)
- tools (12)
- cmd (1)
- os (0)
- CI (0)
- shell (0)
- C (2)
- haskell (49)
- functional (1)
- tool (1)
- gnu (1)
- linux (1)
- kaskell (0)
- svn (0)
- wcf (3)
- android (1)
最新评论
You specify how you want the information you're serializing to be structured by defining protocol buffer message types in .proto files. Each protocol buffer message is a small logical record of information, containing a series of name-value pairs. The detailed language guide can be found
As a walk-through, we create an Echo message which has three fields.
content: type is strnig and multiplicity is [1..1]
value: type is int32 and multiplicity is [0..1]
value_array: type is int32 and multiplicity is [0..*]
so with this in mind, you may come up with the following definition.
package sample; message Echo { required string content = 1; optional int32 value = 2; repeated int32 value_array = 3; }
and one word on the union approach.
A key difference between GPB and XML is that GPB messages are not self describing. This means that the process receiving the message has to know what type it is before parsing. While there are cases where there is only one type of message being sent on a connection, the majority of applications send and receive multiple types of messages. So how do you make sure that the recipient application knows how to decode your message? One solution is to create a wrapper message that has one optional field for each possible message type. For example, if you have message types Foo, Bar, and Baz, you can combine them with a type like:
message OneMessage { optional Foo foo = 1; optional Bar bar = 2; optional Echo echo = 3; }
发表评论
-
wpf - example to enhance ComboBox for AutoComplete
2014-09-19 15:56 1976first let’s see an example ... -
Investigate and troubleshoot possible memory leak issue of .NET application
2014-07-31 10:42 0Hi All, I would like to sh ... -
C# – CoerceValueCallback合并、替换元数据值
2013-08-05 21:59 1925Topic: C# – CoerceValueCallbac ... -
wpf – ListView交替背景色
2013-07-02 20:56 6551Wpf – Alternate background col ... -
C# - 简单介绍TaskScheduler
2013-06-29 17:18 12038标题: C# - 简单介绍TaskSchedulerTit ... -
c# - Get enum from enum attribute
2013-06-27 21:32 1244DescriptionAttribute gives the ... -
C# - PInvoke, gotchas on the RegisterClassEx and the CreateWindowEx
2013-06-24 13:49 2571I get an exception message li ... -
c# - Use PInvoke to create simple win32 Application
2013-06-24 11:59 10946In this post, .net platform h ... -
c# - Linq's Select method as the Map function
2013-06-19 18:47 1287If you comes from a functiona ... -
c# - Tips of Linq expression Any to determine if a collection is Empty
2013-06-19 18:29 938When you are @ the linq expres ... -
myth buster - typeof accepting array of types not acceptable
2013-06-19 17:17 813I have seen from some book whe ... -
windows - trying to create WIN32 application with PInvoke
2013-06-19 14:34 0While it is stupid to do such ... -
WPF - Setting foreground color of Entire window
2013-06-13 16:00 1918You might as well as I would s ... -
WPF - Enhanced TabControl - TabControlEx aka Prerendering TabControl
2013-06-13 13:12 5330As an opening word, let's che ... -
wpf - ControlTemplate and AddLogicChild/RemoveLogicalChild
2013-06-10 15:42 1185Recently I was trying to debug ... -
c# - P/Invoke, DllImport, Marshal Structures and Type conversions
2013-06-05 15:25 1712P/Invoke as in the following q ... -
c# - A study on the NativeWindow - encapsulate window handle and procedure
2013-06-05 14:40 6091NativeWindow gives you a way t ... -
WCF - Notify server when client connects
2013-06-03 18:19 1220It is sometimes very importan ... -
wcf - Debug to enable Server exception in Fault message
2013-06-03 15:47 1091WCF will be able to send back ... -
c# - determine if a type/object is serialzable
2013-05-30 16:35 867In WCF, primitives type are s ...
相关推荐
头文件包含了Protocol Buffer的类定义和API,如`google/protobuf/message.h`,`google/protobuf/descriptor.h`等,这些使得开发者能够定义数据结构(.proto文件),生成相应的C++代码,并进行序列化和反序列化操作。...
Protocol Buffer(简称protobuf)是Google推出的一种数据序列化协议,它能够将结构化数据序列化,可用于数据存储、通信协议等方面。本项目结合了cocos2d-x与protobuf,旨在为Android平台的游戏开发提供高效的数据...
赠送jar包:proto-google-common-protos-1.17.0.jar; 赠送原API文档:proto-google-common-protos-1.17.0-javadoc.jar; 赠送源代码:proto-google-common-protos-1.17.0-sources.jar; 赠送Maven依赖信息文件:...
Protocol Buffer(简称protobuf)是Google开发的一种数据序列化协议,它是跨平台、语言无关的,用于结构化数据的高效序列化方法。protobuf提供了一种方式将数据结构定义为.proto文件,然后可以使用protobuf编译器...
"proto"通常是protobuf(Protocol Buffers)的缩写,这是一种由Google开发的数据序列化协议,用于高效地存储和交换结构化数据。"duplexer"可能指的是一个能够同时处理双向通信的组件,这在设计复杂的网络服务时非常...
Protocol Buffer是Google开发的一种高效、灵活且跨平台的数据序列化协议,用于结构化数据的序列化,类似于XML、JSON,但更小、更快、更简单。它能够将结构化的数据序列化,可用于数据存储、通信协议等方面。Protocol...
### Protocol_Buffer官网文档中文版知识点总结 #### 一、简介与概览 - **Protocol Buffer**是一种用于数据序列化的高效工具,支持多种编程语言(如Java、C++、Python等),能够实现数据的有效存储和传输。 #### ...
Google Protocol Buffer(简称protobuf)是Google推出的一种高效的数据序列化协议,它允许开发者定义数据结构,然后生成可以在各种数据平台之间交换数据的代码。protobuf的主要优势在于它的效率、跨平台性和可扩展性...
Protocol Buffer 使用 `.proto` 文件来定义消息结构,例如 `MyMessage.proto`。在 `.proto` 文件中,我们可以定义消息结构、字段类型、字段名称等信息。 ``` message LogonReqMessage { required int64 acctID = 1...
Protocol Buffer是Google开发的一种数据序列化协议,它允许开发者定义数据结构,并在各种数据平台之间交换这些数据。Sublime Text 3是一款广受欢迎的代码编辑器,拥有丰富的插件库来增强其功能。"Protocol Buffer ...
daas-dac-backend-2.2.0-proto.jar
daas-sabot-kernel-2.2.0-proto.jar
- 使用 Protocol Buffer 语法描述需要存储的数据类型(.proto 文件),这一步骤至关重要,因为 .proto 文件是整个数据模型的基础。 - 使用 Protocol Buffer 编辑器编译 .proto 文件,生成对应的平台代码文件。这一...
ProtocolBuffer,简称PB,是由Google开发的一种数据序列化协议,它是Google的一种二进制数据交换格式,用于结构化数据的序列化。Protocol Buffers的设计目标是替代XML等传统数据交换格式,提供更高效、更小的数据...
Protocol Buffer(简称PB)是Google开发的一种数据序列化协议,用于高效地编码和解码结构化数据。它提供了一种跨平台、语言无关的方式,使得应用程序可以方便地存储、交换和解析数据。Protocol Buffer文件(通常扩展...
Protocol Buffer是Google开发的一种数据序列化协议,它提供了一种高效、跨平台的方式来存储和传输结构化数据。Protocol Buffer的主要功能是将复杂的数据结构转换为二进制流,以便在网络中高效地传输或者持久化存储。...
android-test-plugin-host-additional-test-output-proto-30.3.1-sources.jar
Google Protocol Buffer(简称Protobuf)是一种由Google开发的跨语言、跨平台的序列化框架,主要用于数据的序列化、反序列化,是一种更灵活、高效、自动化的机制。相比于XML等数据交换格式,Protocol Buffer具有更小...
Protocol Buffer是Google开发的一种数据序列化协议,它允许开发者定义数据结构,并将其转换为二进制格式进行存储或网络传输。Protocol Buffer 3.0 (简称protobuf) 是该技术的第三个主要版本,提供了更强大的功能和...