Questions tagged [protocol-buffers]

For questions about Google's protocol buffers

Protocol buffers are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data – think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.

https://developers.google.com/protocol-buffers

7638 questions
4
votes
1 answer

Use enums from external class to avoid define in .proto?

I have three different format of messages in code and I made all three .proto files and compiled. I already have another, to say regular,class with lots of enums and I need to use that enums in all three classes. Is there any way to use enums from…
PaolaJ.
  • 10,872
  • 22
  • 73
  • 111
4
votes
5 answers

Getting one repeated field from a file instead of needing to load the whole file

Lets say I have a .proto structured (simplified) like this Message DataItem { required string name = 1; required int32 value = 2; } Message DataItemStream { repeated DataItem items = 1; } The server will make the DataItemStream and write it…
g19fanatic
  • 10,567
  • 6
  • 33
  • 63
4
votes
2 answers

protobuf 2.4.1 - sending data from c++ to Java

I'm trying to exchange messages between c++ and java and vice-versa without success. I've defined two messages (1 to be sent from c++ to java and another to be sent the other way around) with union types (see attached .proto). The c++ code is as…
Valadas
  • 41
  • 2
4
votes
2 answers

protobuf-net List<> inheritance deserialization

I have problem with deserialization using protobuf-net. I have the following class: [ProtoContract] public class CrazyList : List { [ProtoMember(1)] private readonly string _foo; public CrazyList(string foo) { _foo =…
epifun
  • 109
  • 7
4
votes
1 answer

Protobuffers in c++ and error LNK2019: unresolved external symbol

I am new to c++ and visual studio 2012 so probably the problem is between the screen and the chair. I performed the following steps; I made a simple proto file with the option optimize_for = LITE_RUNTIME Create the matching h and c files with…
Aktaeon
  • 189
  • 2
  • 14
4
votes
1 answer

Protobuf-net possible recursion detected: serialize children and parents

I am new to serialization in general, and even newer to protobuf. Here is my problem, I have these classes: [ProtoContract] class Controle { [ProtoMember(1, AsReference=true)] public HashSet ControlesInternes { get; set; } …
GianT971
  • 4,385
  • 7
  • 34
  • 46
4
votes
2 answers

Why won't enums deserialize with protobufs?

I have a class that I serialize, then deserialize using Protobuf-net version r431 (probably a year old or so). The class contains an enum _type and a string called _band. In the constructor, _type is set to StationType.Other and _band is set to an…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
4
votes
1 answer

Read value of enum extension in protocol buffer

I just asked this question and have resolved to write an extension for enum values in my protocol buffer. However I am having an extremely difficult time actually reading the values back, even with this simple .proto file: package test; import…
user812786
  • 4,302
  • 5
  • 38
  • 50
4
votes
0 answers

Protocol Buffers vs Thrift: which is quicker to build server / client with?

So we want to build a server/client system in C++, and I am unclear whether Google protocol buffers or thrift will get us a working prototype more quickly. We want to use TCP sockets as the communication layer, for communication over a local subnet…
4
votes
3 answers

Google Protocol Buffers or something similar for .net/javascript

We are currently using Ajax calls to a .net web service that then returns a Json object to the client. Some of these Json objects are pretty massive (> 500k uncompressed). We have heard some good things about Google Protocol Buffers and have been…
user95023
  • 91
  • 1
  • 4
4
votes
1 answer

Inserting an item at the beginning of a protobuf list

I'm trying to insert an item at the beginning of a protobuf list of messages. add_foo appends the item to end. Is there an easy way to insert it at the beginning?
Matthew Finlay
  • 3,354
  • 2
  • 27
  • 32
4
votes
4 answers

Using Protocol Buffers to send icons/small images

I have a simple question about std::string and google's protocol buffers library. I have defined a message like so: message Source { required string Name = 1; required uint32 Id = 2; optional string ImplementationDLL = 3; optional…
Ahmad Mushtaq
  • 1,395
  • 1
  • 10
  • 32
4
votes
1 answer

Protobuf with NodeJS on Windows

I would like to send simple TCP message to a device (Karotz) from NodeJS Script on Windows. NodeJS correctly installed an working TCP connection working Here is my .proto file (http://wiki.karotz.com/index.php/Voos-message.proto) I compile it to…
Jean-Philippe Encausse
  • 1,491
  • 2
  • 22
  • 40
4
votes
1 answer

Is protobuf always required in redis?

I am working on developing a key value store using redis. I proposed using a hashmap of type String(key)-->Object(value). I am advised to serilaize the object using protobuf. If we are going to populate as well as read this data using Java (which is…
user1017860
  • 190
  • 3
  • 11
4
votes
2 answers

How to serialize .Net Exceptions using Protobuf-Net?

Can anyone give me an example or point me to a resource on how to use Protobuf-Net to serialize/deserialize some of the bulit-in system classes? Specifically I'm just trying to serialize/deserialize the base Exception class and all other exception…
WiredWiz
  • 646
  • 8
  • 18