protocol-buffers

Serializing and deserializing unknown inherited types

I started looking at using proto-buf .Net for my serialization needs for media browser. In the new system we have a entity framework that can be extended with plug-ins. So, for example, we define a Media class in the core library, and then plug-ins can define subclasses such as Song. It seems that proto-buf .Net needs to know about...

Is there ever a good time to use int32 instead of sint32 in Google Protocol Buffers?

I've been reading up on Google Protocol Buffers recently, which allows for a variety of scalar value types to be used in messages. According to their documentation, there's three types of variable-length integer primitives - int32, uint32, and sint32. In their documentation, they note that int32 is "Inefficient for encoding negative nu...

How do you transfer binary data with Python?

I'm working on a client-server program for the first time, and I'm feeling woefully inadequate on where to begin for what I'm doing. I'm going to use Google Protocol Buffers to transfer binary data between my client and my server. I'm going to be using the Python variant. The basic idea, as I understand, is that the client will serial...

Available Game network protocol definition languages and code generation

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...

Protocol Buffers: Should I use int64 or fixed64 to represent a .NET DateTime value?

I need to serialize a .NET DateTime value in a protocol buffers message. My plan is to use the DateTime.ToBinary() and then pass the 64-bit returned value in the message. But I'm not sure what to choose as a protocol buffers data type to represent that. I guess I'm confused about when the fixed64 (or sfixed64) data types should be use...

Compiling Protobuf C++ Code

I have the mytest.cc and mytest.h output from a mytest.proto file, but I can't find any reference on to how to compile a object using g++ for this. (the .proto is fine as I got it working with Python) g++ mytest.cc -l??????? what libraries to include? ...

What's the best method of Encryption whilst using ProtoBuf?

I've migrated my database on my mobile device away from VistaDB because it's just too slow. I'm now using ProtoBuf instead to create a series of flat files on a Storage Card, the only issue is there's obviously no encryption. Which encryption method works best with ProtoBuf? I'm basically serializing a collection of data entities to a f...

Obfuscation and protobuf.net - Exception: default enum value not defined

I'm being presented with the following Exception when trying to serialize a class that contains enums in an obfuscated project: ProtoBuf.ProtoException: The default enum value X is not defined for the optional property Y If I exclude all affected enums from obfuscation everything runs fine, however, I switched to protobuf.net to be...

What does the ProtoInclude attribute mean (in protobuf-net)

In the ProtoBuf-Net implementation, what does the ProtoInclude attribute mean, and what does it do? An example would be appreciated. I saw it in this post and I'm not sure what it does. The example was: [Serializable, ProtoContract, ProtoInclude(50, typeof(BeginRequest))] abstract internal class BaseMessage { [ProtoMember(1)] abst...

Eclipse plugin for working with protobuf

Protocol Buffers (protobuf) are a way of encoding structured data in an efficient yet extensible format. There's plugin for Netbeans, but I cannot find one for Eclipse. Does it exist? If yes, please, share the link. Thanks. ...

What is the best approach for serializing BigDecimal/BigInteger to ProtocolBuffers

Hi I am starting to migrate a custom serialization mechanism to Protocol Buffers. One data type that will be used particularly regularly is BigDecimal. Does anyone know of a good way of serializing this within Protocol Buffers? Our current serialization routine uses BigDecimal.toPlainString() for serialization, and new BigDecimal(Strin...

boost serialization vs google protocol buffers?

Does anyone with experience with these libraries have any comment on which one they preferred? Were there any performance differences or difficulties in using? ...

How would you encode a Map<String, Object> using Protocol Buffers?

I'm trying to use Protocol Buffers for message serialization. My message format should contain Map< String, Object > entries ... but how do I write the .proto definition? As far as I know, Protocol Buffers does not have a build-in Map type. I could model around that using repeating fields. But the big problem I have is, that you need ...

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 bytes Icon = 4; } I want to use the Icon field to send an image, it most probably will b...

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 experimenting. So far, we have had pretty good luck serializing on the server with what s...

What's the project of choice for compiling GPB to AS3?

Inside a Java project I use Google Protocol Buffers (GPB) for serializing my objects. I can use the same .proto files in auxiliary Python code, which is great. Now I'm adding a Flex client to the whole thing and I'd like to use the same .proto files once more. It seems there's a couple of projects out there which compile .proto files to...

How do I get support for GPB in Eclipse?

I'm trying to use Google Protocol Buffers in my project and I'd like to have some tooling support from Eclipse. In particular, I want Eclipse to call protoc every time I make changes to the .proto files and then rebuild all code that depends on the generated code. I tried to set up a Custom Builder but it keeps bugging me with errors I ...

Protocol Buffers with JPA

I'm currently building a P2P-system which uses Protocol Buffers for all communication between the peers. There's also a some centralized parts of the system where the peers communicate with a server. The server uses JPA to store the data it has about the peers. So essentially the clients has its data in Protocol Buffers-messages and the...

Google protocol buffers and servlets

I am wondering how I can use google protocol buffers to accept a request and send a response back to a client? I am thinking about writing a servlet which will take a request. Is the following trail of thought the correct way to implement this: 1. Have a .proto file which is the message definition for the incoming request. 2. Write a ser...

How do I get Eclipse to resolve classes generated with Maven 2?

I'm using Google Protocol Buffers to generate some Java classes for my project. Using Maven 2 and its "antrun" plugin, these classes are freshly generated before compile, output to target/generated-sources and put on the classpath during the build. So building the project from the POM is no problem. However, Eclipse doesn't know how to ...