protocol-buffers

Protocol buffer: does changing field name break the message?

女生的网名这么多〃 提交于 2019-12-03 05:38:07
With protocol buffer, does changing field name of a message still let it compatible backward? I couldn't find any cite about that. Eg: original message message Person { required string name = 1; required int32 id = 2; optional string email = 3; } Change to: message Person { required string full_name = 1; required int32 id = 2; optional string email = 3; } Changing a field name will not affected protobuf encoding or compatibility between applications that use proto definitions which differ only by field names. The binary protobuf encoding is based on tag numbers, so that is what you need to

Available Game network protocol definition languages and code generation

无人久伴 提交于 2019-12-03 05:15:34
问题 I've been looking for a good general purpose binary network protocol definition framework to provide a way to write real-time game servers and clients (think World Of Warcraft or Quake III) in multiple languages (e.g. Java backend server and iPhone front-end client written in Objective-C and Cocoa). I want to support Java Flash clients, iPhone clients and C# clients on windows (and XNA clients on XBOX). I'm looking for a way to efficiently send/receive messages over a TCP/IP or UDP socket

CMake with Google Protocol Buffers

左心房为你撑大大i 提交于 2019-12-03 05:06:24
问题 I'm trying to use cmake to build my little project using protocol buffers. There's a root directory with a number of subdirectories with a number of libraries and executables. My first thought was to have my .proto-files in a subdirectory, but when I read this answer I made a library out of it instead. But when I try to include a messages header in my executable it can't find it. Error message: fatal error: msgs.pb.h: No such file or directory #include "msgs.pb.h" ^ compilation terminated. I

simple protobuf compilation with gradle

别等时光非礼了梦想. 提交于 2019-12-03 04:57:54
问题 If you're looking for sample gradle protobuf project look here. I'm having hard time with gradle and protobuf, i want to create a simple gradle project that will take any proto files from default src/main/proto , src/test/proto and compile them to src/main/java , src/test/java accordingly, then pack that into a jar and publish to local repo. Unfortunately i'm new to gradle and cant figure out how the original project is composed. Here is my unfinished build.gradle file apply plugin: 'java'

Loading SavedModel is a lot slower than loading a tf.train.Saver checkpoint

匆匆过客 提交于 2019-12-03 04:48:06
问题 I changed from tf.train.Saver to the SavedModel format which surprisingly means loading my model from disk is a lot slower (instead of a couple of seconds it takes minutes). Why is this and what can I do to load the model faster? I used to do this: # Save model saver = tf.train.Saver() save_path = saver.save(session, model_path) # Load model saver = tf.train.import_meta_graph(model_path + '.meta') saver.restore(session, model_path) But now I do this: # Save model builder = tf.saved_model

Is there a definitive *nix command line tool for inspecting protocol buffers? [closed]

醉酒当歌 提交于 2019-12-03 04:43:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 months ago . I'm looking for a command-line utility that will, at a minimum, render binary protobuf data in human-readable form. Filtering and selection options (along the lines of cut for text) would be nice, but the primary object is to make the data visible for debugging purposes. If there is no definitive tool for the

How to assign to repeated field?

梦想的初衷 提交于 2019-12-03 02:54:59
问题 I am using protocol buffers in python and I have a Person message repeated uint64 id but when I try to assign a value to it like: person.id = [1, 32, 43432] I get an error: Assigment not allowed for repeated field "id" in protocol message object How to assign a value to a repeated field ? 回答1: As per the documentation, you aren't able to directly assign to a repeated field. In this case, you can call extend to add all of the elements in the list to the field. person.id.extend([1, 32, 43432])

Can I define a grpc call with a null request or response?

不打扰是莪最后的温柔 提交于 2019-12-03 02:29:30
问题 Does the rpc syntax in proto3 allow null requests or responses? e.g. I want the equivalent of the following: rpc Logout; rpc Status returns (Status); rpc Log (LogData); Or should I just create a null type? message Null {}; rpc Logout (Null) returns (Null); rpc Status (Null) returns (Status); rpc Log (LogData) returns (Null); 回答1: Kenton's comment below is sound advice: ... we as developers are really bad at guessing what we might want in the future. So I recommend being safe by always

python example for reading multiple protobuf messages from a stream

大城市里の小女人 提交于 2019-12-03 02:09:32
I'm working with data from spinn3r, which consists of multiple different protobuf messages serialized into a byte stream: http://code.google.com/p/spinn3r-client/wiki/Protostream "A protostream is a stream of protocol buffer messages, encoded on the wire as length prefixed varints according to the Google protocol buffer specification. The stream has three parts: a header, the payload, and a tail marker." This seems like a pretty standard use case for protobufs. In fact, protobuf core distribution provides CodedInputStream for both C++ and Java. But, it appears that protobuf does not provide

How to visualize data from google protocol buffer?

徘徊边缘 提交于 2019-12-03 01:29:35
I would like to store data using google protocol buffers (another serialized format would work, too), and then have an UI to browse that data. Is there a C++ framework/API that would allow me to do this? For example, it could use the reflection interface of protobuf, and then fill in the data into Qt's QTableView (or from another toolkit). I could write such code myself -- however, much rather I would re-use existing code, which is why I am asking for advice here! Or are there more general UI toolkits that can visualize data which is accessible via some reflection API? One GUI I just came