protobuf-net

Sending explicit zeroes in protobuf3

…衆ロ難τιáo~ 提交于 2021-02-05 07:11:29
问题 In Protobuf3 zero is the default value for numeric types, and so they are filtered out when serialized. I have an application where I need to send a value only when it has changed. For example, x was 1, now x is 0, send this value. It isn't possible to send only the delta, eg -1, because some of these values are floats or doubles, and we do not want to accrue errors. There are over 200 different variables in some classes I need to serialize, so solutions like "add a boolean to flag which

Strange error with Keras and Spyder

时光毁灭记忆、已成空白 提交于 2020-08-07 01:32:22
问题 I'm using Spyder to do some small projects with Keras, and every now and then (I haven't pinned down what it is in the code that makes it appear) I get this message: File "~/.local/lib/python3.5/site-packages/google/protobuf/descriptor_pb2.py", line 1771, in <module> __module__ = 'google.protobuf.descriptor_pb2' TypeError: A Message class can only inherit from Message Weirdly, this exception is not raised if I execute the program outside of Spyder, using the terminal. I've looked around and I

Strange error with Keras and Spyder

两盒软妹~` 提交于 2020-08-07 01:29:21
问题 I'm using Spyder to do some small projects with Keras, and every now and then (I haven't pinned down what it is in the code that makes it appear) I get this message: File "~/.local/lib/python3.5/site-packages/google/protobuf/descriptor_pb2.py", line 1771, in <module> __module__ = 'google.protobuf.descriptor_pb2' TypeError: A Message class can only inherit from Message Weirdly, this exception is not raised if I execute the program outside of Spyder, using the terminal. I've looked around and I

How can I connect a gRPC client in .NET framework with a secure .NET Core server?

北城以北 提交于 2020-08-05 03:59:28
问题 I'm using protobuf-net.Grpc on a .NET Core server and trying to make calls from a .NET Framework (4.7.2.) gRPC Client. A full example is here: https://github.com/angelagyang/GRPCProtobufExample Here is a snippet of my client: var channelCreds = new SslCredentials(GetRootCertificates()); var channel = new Channel("localhost", 5001, channelCreds); var greeter = channel.CreateGrpcService<IGreeterService>(); With this configuration, I get the error StatusCode="Unknown", Detail="Stream removed"...

In a proto, how can I define a map as a custom option

試著忘記壹切 提交于 2020-04-16 02:43:24
问题 In my proto file, I want to define a map as a custom option, tried a few things but none is working. my metadata proto file: syntax = "proto2"; import "google/protobuf/descriptor.proto"; package com.util; option java_package = "com.util"; message MyMeta { optional bool needValidation = 1; map<string, string> fileMap = 2; } extend google.protobuf.FieldOptions { optional MyMeta meta = 80412; } my proto file syntax = "proto3"; package com.test; import "util/meta.proto"; import "google/protobuf