protocol-buffers

Make a GET and POST service call with Retrofit with the use of Protobuf (Protocol Buffer)

走远了吗. 提交于 2019-12-24 17:22:42
问题 Can anyone please give me some example how we can use protobuf in retrofit - I tried but its failed with some error , let me give you a sample of my implementation on that. I hope you guys will help me. ApiInterface.java public interface ApiInterface { @GET Call<CommonProto.Country> makeGetRequest(@Url String url); } ApiClient.java public class ApiClient { public static final String BASE_URL = "**************************"; private static Retrofit retrofit = null; public static Retrofit

Protobuf-net won't deserialize data from Protobuf.js

随声附和 提交于 2019-12-24 16:33:24
问题 I'm using Protobuf for the communication between my web client and server (C#), using WebSocket. On the client, the de/serialization is done through Protobuf.js and, on the server, using protobuf-net. The problem is that, when using aggregation with abstract classes, protobuf-net can't deserialize the data sent by Protobuf.js. This is the stack trace: ProtoException: No parameterless constructor found for Base. at ProtoBuf.Meta.TypeModel.ThrowCannotCreateInstance(Type type) na c:\Dev\protobuf

Getting IllegalStateException when starting the grpc server

强颜欢笑 提交于 2019-12-24 15:36:27
问题 I am using grpc for my API development. I was able to create and access API's so far. All of a sudden I am seeing this exception stack trace continuously some 5 seconds after the "INFO: Server started. Listening on port 42420" message is displayed. I have deployed this project and bringing the server up on a GCE instance. Please let me know the reason and solution for this issue if anyone have faced it before. Stack trace: May 11, 2016 7:14:20 AM io.grpc.internal.AbstractServerStream

zeromq with protobuf segmentation fault while parsing in c++

前提是你 提交于 2019-12-24 14:28:38
问题 I am using zeromq with protobuf to send/recieve messages but code was crashing on receiver end with Segmentation fault (core dumped) error while parsing the received data. Scan is my message. sender.cpp Scan proto_ls_msg; proto_ls_msg.set_angle_min(0.0); proto_ls_msg.set_angle_max(180.5); std::string ls_msg_str; proto_ls_msg.SerializeToString(&ls_msg_str); zmq::message_t request (ls_msg_str.size()); memcpy (request.data(), ls_msg_str.c_str(),ls_msg_str.size()); socket.send (request);

Does protobuf-csharp-port support Windows RT?

送分小仙女□ 提交于 2019-12-24 12:34:02
问题 protobuf-csharp-port homepage(with sourcecode) In my previous windows phone silverlight 8.0 project I used protobuf-csharp-port to implement the GPB, but now I want to port the project to windows 8.1 and then universal ,so I copy the source code to create a windows runtime component(I am a library developper),but encounter some problems: sounds like the Serializable Attribute is not useful any more So question is: Why the red font?Does protobuf-csharp-port support Windows RT? If not,How can I

How do I correctly include golang protobuf/ptypes for protoc when using dep?

余生长醉 提交于 2019-12-24 11:35:52
问题 I'm having trouble including the google/protobuf/timestamp.proto well known type, when using dep. I get an error: google/protobuf/timestamp.proto: File not found service.proto: syntax = "proto3"; import "google/protobuf/timestamp.proto"; package com.rynop.platform; option go_package = "rpc"; service PlatformService { rpc Test(EmptyMessage) returns (EmptyMessage); } message EmptyMessage { } message A { string summary = 1; google.protobuf.Timestamp start = 2; } message B { repeated A foos = 1;

Should I create a message per method or use a shared message in gRPC?

故事扮演 提交于 2019-12-24 11:01:15
问题 Currently I'm using gRPC as the communication between my servers, but I don't know which is the best pattern. Should I create a shared request message ( UserRequest is treated like an User object): service User { rpc Create (UserRequest) returns (Reply) {} rpc Update (UserRequest) returns (Reply) {} rpc Delete (UserRequest) returns (Reply) {} } message UserRequest { string username = 1; string password = 2; string email = 3; string gender = 4; string birthday = 5; } Or create a message per

Using inception-v3 checkpoint file in tensorflow

血红的双手。 提交于 2019-12-24 10:50:02
问题 In one of my project, I used a public pre-trained inception-v3 model available here : http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz. I only want to use last feature vector (output of pool_3/_reshape:0). By looking at script example classify_image.py, I can successfully pass an image throught the Deep DNN, extract the bottleneck tensor ( bottleneck_tensor = sess.graph.get_tensor_by_name('pool_3/_reshape:0') ) and use it for further purpose. I recently saw that

Building protobuf for Linux using VS2017

我的梦境 提交于 2019-12-24 10:34:54
问题 I have configured VS2017 to build Linux C++ by remote building on a Linux Mint VM. I tried a simple C++ program and it compiles and executes fine, the thing is that now I need to add a generated protobuf source and the linking fails constantly. On the Linux VM the protobuf generated files are building correctly and I was able to execute the gRPC examples. The errors I get when I build from VS2017 are a lot of: undefined reference to 'google::protobuf::internal' and there is also this one C:

Show all elements in a protocol buffer message

荒凉一梦 提交于 2019-12-24 10:26:51
问题 How can I show all elements in a protocol buffer message? Do I need to use reflection or convert the message into an XML message and then show it? Ideally some generic code that will work for any message. Lars 回答1: A protobuf message is internally ambiguous unless you have the .proto schema (or can infer a schema) available, as (for example) a "string" wire-type could represent: a utf-8 string a BLOB a sub-message a packed array Similar ambiguity exists for all wire-types (except perhaps