protocol-buffers

How to build google protobuf environment with cmake on windows?

╄→尐↘猪︶ㄣ 提交于 2019-12-06 13:33:04
I am following the instructions from: https://github.com/google/protobuf/tree/master/cmake cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../../../../install/protobuf ../.. nmake install In my program's CMakeLists.txt i use: find_package(Protobuf REQUIRED) But it tells me: -- Could NOT find Protobuf (missing: Protobuf_LIBRARIES Protobuf_INCLUDE_DIR) I think I should set set the environment variable. Is there a effective way to do this? in protobuf-master/cmake/install.cmake i can see this: configure_file(protobuf-config.cmake.in ${CMAKE_INSTALL_CMAKEDIR}/protobuf

Is it possible to serialize a list of System.Object objects using protocol buffers

雨燕双飞 提交于 2019-12-06 12:49:01
I have a list of objects of various data types (DateTime, int, decimal, string). List<object> myObjects = new List<object>(); myObjects.Add(3); myObjects.Add(3.9m); myObjects.Add(DateTime.Now); myObjects.Add("HELLO"); I was able to serialize this list using protobuf-net, but deserialization always throws the exception: "Additional information: Type is not expected, and no contract can be inferred: System.Object". using (var ms = new MemoryStream()) { Serializer.Serialize(ms, list2); var bytes = ms.ToArray(); ms.Position = 0; var clone = Serializer.Deserialize(typeof(List<object>), ms); /

CMake doesn't work with Google Protobuf

早过忘川 提交于 2019-12-06 12:35:49
问题 Unable to link protobuf library using CMake. My CMakeLists is cmake_minimum_required(VERSION 3.6) project(addressbook) set(CMAKE_CXX_STANDARD 11) set(PROJECT_NAME addressbook) ADD_SUBDIRECTORY(proto) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) ADD_EXECUTABLE(main main.cpp) TARGET_LINK_LIBRARIES(main proto ${PROTOBUF_LIBRARY}) and in proto subdirectory there is another CMakeLists.txt (that way it is done in github repo https://github.com/shaochuan/cmake-protobuf-example) INCLUDE

PROTOBUF_INLINE_NOT_IN_HEADERS

谁说我不能喝 提交于 2019-12-06 12:05:04
I'm trying to install Open Transactions, the open-source project, on a debian 8. I've installed all the dependencies and am having an issue when compiling (make). The following error is showing at my terminal, even though i made sure to install the protobuf project: In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:64:0, from /root/opentxs/src/core/OTStorage.cpp:47: /root/opentxs/build/src/core/otprotob/Generics.pb.h:501:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef] #if !PROTOBUF_INLINE_NOT_IN_HEADERS ^ In file included from /root

Protobuf RPC not available on Hadoop 2.2.0 single node server?

本秂侑毒 提交于 2019-12-06 12:03:09
I am trying to run a hadoop 2.2.0 mapreduce job on my local single node cluster installed by following this tutorial: http://codesfusion.blogspot.co.at/2013/10/setup-hadoop-2x-220-on-ubuntu.html?m=1 Though on the server side the following exception is thrown: org.apache.hadoop.ipc.RpcNoSuchProtocolException: Unknown protocol: org.apache.hadoop.yarn.api.ApplicationClientProtocolPB at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.getProtocolImpl(ProtobufRpcEngine.java:527) at org.apache.hadoop.ipc.ProtobufRpcEngine$Server$ProtoBufRpcInvoker.call(ProtobufRpcEngine.java:566) at

Google Protocol buffers in client/server when have different packet type [closed]

三世轮回 提交于 2019-12-06 12:00:45
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . Closed 8 years ago . I want to use protocol buffers in tcp/ip communication, but i may have different packets to send/receive, how can i differentiate the package types over protocol buffers, it seems I have to know the next packet type to use protocol buffer, but in my case, i may don't know the type in advance. any idea? is

Serializing and Sending a Protocol Buffers Message

只谈情不闲聊 提交于 2019-12-06 11:41:29
I have written this protobuf message in c# C# client: public AddressBook InitializeAdressBook() { Person newContact = new Person(); AddressBook addressBookBuilder = new AddressBook(); Person john = new Person(); john.id=1234; john.name="John Doe"; john.email="jdoe@example.com"; Person.PhoneNumber nr = new Person.PhoneNumber(); nr.number="5554321"; john.phone.Add(nr); addressBookBuilder.person.Add(john); TextBox.Text += ("Client: Initialisiert? " + addressBookBuilder.ToString()) + "\t" + "\n"; TextBox.Text += " Erster Person " + addressBookBuilder.person.First().name + "\t" + "\n"; return

When using google protocol buffers to transfer String character,got messy code

余生长醉 提交于 2019-12-06 10:43:02
In debug view: Here is the code which encodes into messy string... ((S2CEnterCollection)objS2c).toByteString().toStringUtf8(); Output: ���"default( ���"default( ���"default( ���"default( ���"default( ����"default( ����"default( �����"default( Here is the code which has the right string: ((S2CEnterCollection)objS2c).toString() The original string was: cardList { cardId: 100001 liked: 100 number: 10 finder: "default" rank: 1 } cardList { cardId: 100002 liked: 123 number: 10 finder: "default" rank: 1 } cardList { cardId: 100003 liked: 543 number: 10 finder: "default" rank: 1 } cardList { cardId:

Protobuf InvalidProtocolBufferException with some strings

北慕城南 提交于 2019-12-06 10:33:01
问题 We using protobuf v.3 to transfer messages from C# client to Java server over HTTP. The message proto looks like this: message CLIENT_MESSAGE { string message = 1; } Both client and server uses UTF-8 character encoding for strings. Everything is fine whe we are using short string values like "abc", but when we trying to transfer string with 198 chars in it, we catchig an Exception: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended

Jmeter protobuf testing. Could not read Protobuf message

青春壹個敷衍的年華 提交于 2019-12-06 10:25:00
I am testing one project via protobuf protocol and using HTTP Request Sampler. The target appserver is also written on Java. There is a problem with errors in reponses: "Could not read Protobuf message: Protocol message contained an invalid tag (zero).; nested exception is com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero)" The case is that it is happening not in 100% requests. When i used HttpClient4 it was about 30-40% of failed requests. After i changed it to HttpClient3.1 error rate decreased down to ~10% which is also not a good deal. To