protobuf-net.Grpc | GRPC bindings for protobuf-net and grpc-dotnet

 by   protobuf-net C# Version: 1.1.1 License: Non-SPDX

kandi X-RAY | protobuf-net.Grpc Summary

kandi X-RAY | protobuf-net.Grpc Summary

protobuf-net.Grpc is a C# library typically used in Web Services applications. protobuf-net.Grpc has no bugs, it has no vulnerabilities and it has low support. However protobuf-net.Grpc has a Non-SPDX License. You can download it from GitHub.

protobuf-net.Grpc adds code-first support for services over gRPC using either the native Grpc.Core API, or the fully-managed Grpc.Net.Client / Grpc.AspNetCore.Server API. It should work on all .NET languages that can generate something even remotely like a regular .NET type model.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              protobuf-net.Grpc has a low active ecosystem.
              It has 715 star(s) with 105 fork(s). There are 44 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 78 open issues and 123 have been closed. On average issues are closed in 126 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of protobuf-net.Grpc is 1.1.1

            kandi-Quality Quality

              protobuf-net.Grpc has 0 bugs and 0 code smells.

            kandi-Security Security

              protobuf-net.Grpc has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              protobuf-net.Grpc code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              protobuf-net.Grpc has a Non-SPDX License.
              Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.

            kandi-Reuse Reuse

              protobuf-net.Grpc releases are available to install and integrate.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of protobuf-net.Grpc
            Get all kandi verified functions for this library.

            protobuf-net.Grpc Key Features

            No Key Features are available at this moment for protobuf-net.Grpc.

            protobuf-net.Grpc Examples and Code Snippets

            No Code Snippets are available at this moment for protobuf-net.Grpc.

            Community Discussions

            QUESTION

            Trying to serialize System.Numerics.Quaternion using protobuf-net
            Asked 2020-Oct-29 at 10:25
            Background Info

            I have a .Net Standard 2.0 class library that uses Protobuf-net.grpc's code first approach to define a gRPC service. In this definition I have classes defining different data structures that we are using to record sensor data and serialize this out using protobuf-net. My programs are ingesting serveral hundred thousand large objects /s (which will soon scale into the millions) and are intended to be used in embedded environments.

            Problem

            In my class below, I would like to include as a member a System.Numerics.Quaterion. I cannot seem to get this serialized out. Using static constructors, the RuntimeTypeModel throws exceptions as the Quaternion model has somehow already been created by the time the static constructor is executed. As this is a class library, and I desperately want to avoid invoking the RuntimeTypeModel in each different program using the gRPC service. I'm hoping to find a way to serialize the System.Numerics.Quaternion.

            I have tried placing this static constructor runtime definition at the highest level of the class hierarchy to no avail. Exceptions still thrown.

            ...

            ANSWER

            Answered 2020-Oct-29 at 10:25

            This is ultimately a timing problem - when the serializer attempts to reflect on SensorData to prepare the serializer, the static constructor in IMUData has not yet executed, so it prepares the serializer with incomplete information, and then later the static constructor tries to reconfigure the model - too late.

            If you use C# 9.0, you can fix this by using a module initializer instead of a static constructor (if we assume that SensorData and IMUData are in the same module, which is probably a safe assumption). The following works fine, for example:

            Source https://stackoverflow.com/questions/64581076

            QUESTION

            Use protobuf-net RuntimeTypeModel with GrpcClient (AddCodeFirstGrpcClient)
            Asked 2020-Sep-22 at 09:53

            i try to use a custom protobuf-net RuntimeTypeModel with the protobuf-net grpc client library. What I understand so far, I need to to use the ClientFactory and set a binder-configuration which references my RuntimeTypeModel-Instance.

            ...

            ANSWER

            Answered 2020-Sep-22 at 09:53

            You need to register the ClientFactory with the DI layer:

            Source https://stackoverflow.com/questions/64007048

            QUESTION

            How can I connect a gRPC client in .NET framework with a secure .NET Core server?
            Asked 2020-Jul-24 at 21:48

            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:

            ...

            ANSWER

            Answered 2020-Jul-09 at 23:06

            Solved and updated the original example: https://github.com/angelagyang/GRPCProtobufExample

            You can configure a client certificate by creating a KeyCertificatePair to pass into SslCredentials. You will need the PEM encoded certificate chain and PEM encoded private key.

            Source https://stackoverflow.com/questions/62803003

            QUESTION

            Exception when adding new method in a working Service using gRPC-Web and protobuf-net
            Asked 2020-Jul-07 at 07:38

            I am getting the following exception:

            Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: The type initializer for 'DefaultProxyCache1' threw an exception. System.TypeInitializationException: The type initializer for 'DefaultProxyCache1' threw an exception. ---> System.ArgumentException: Invalid generic arguments Parameter name: typeArguments at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.MakeGenericMethod_impl(System.Reflection.RuntimeMethodInfo,System.Type[]) at System.Reflection.RuntimeMethodInfo.MakeGenericMethod (System.Type[] methodInstantiation) <0x342def8 + 0x000d6> in :0 at ProtoBuf.Grpc.Internal.ContractOperation.TryGetClientHelper () [0x0001b] in //src/protobuf-net.Grpc/Internal/ContractOperation.cs:291 at ProtoBuf.Grpc.Internal.ProxyEmitter.EmitFactory[TService] (ProtoBuf.Grpc.Configuration.BinderConfiguration binderConfig) [0x00477] in //src/protobuf-net.Grpc/Internal/ProxyEmitter.cs:238 at ProtoBuf.Grpc.Internal.ProxyEmitter.CreateFactory[TService] (ProtoBuf.Grpc.Configuration.BinderConfiguration binderConfig) [0x0006d] in //src/protobuf-net.Grpc/Internal/ProxyEmitter.cs:123 at ProtoBuf.Grpc.Configuration.ClientFactory+DefaultProxyCache`1[TService]..cctor () [0x00000] in //src/protobuf-net.Grpc/Configuration/ClientFactory.cs:81

            My project uses gRPC-Web, Blazor web assembly and protobuf-net

            This is my service contract:

            ...

            ANSWER

            Answered 2020-Jul-07 at 07:38

            That is... odd. I can't repro it here, so I'm guessing it is something specific to Blazor. I've checked what the code does in the "regular" frameworks, and at least for me it seems to do the right things - using UnaryValueTaskAsync() and UnaryValueTaskAsync(), which is what I would expect. I've improved the exception handling in that code path, to at least give us a clue what it is trying to do, so my suggestion is:

            • update to protobuf-net.Grpc version >= 1.0.119 (I'll get it deployed as soon as CI finishes)
            • retry, and let me know exactly what it says now

            Alternatively, if you have a minimal repro including the blazor bits on, say, a GitHub repo, I can happily take a look there.

            (tip: I try to keep an eye on both Stack Overflow and GitHub, but GitHub is probably more appropriate for this kind of question - I'd happily say that this is a bug, so: https://github.com/protobuf-net/protobuf-net.Grpc/issues)

            Source https://stackoverflow.com/questions/62732593

            QUESTION

            Is it possible to set the default Serializer to a pre-compiled one in protobuf-net?
            Asked 2020-Jun-26 at 09:53

            I am using protobuf-net with protobuf-net.grpc and am attempting to get it to work on Xmarin/Ios.

            Currently I have attempted to create a pre-compiled serializer:

            ...

            ANSWER

            Answered 2020-Jun-25 at 17:13

            A second read on this reveals that you're actually looking for gRPC support. This is actually possible right now - you just need to provide a custom binder config:

            Source https://stackoverflow.com/questions/62553644

            QUESTION

            Protobuf-net.Grpc Service Contract Inheritance
            Asked 2020-May-12 at 02:20

            I am upgrading an application from .Net FW to .Net Core. Also upgrading WCF services to gRPC services. We have decided to use protobuf-net.Grpc.

            We use multiple levels of inheritance for service contracts.

            ...

            ANSWER

            Answered 2020-May-12 at 02:20

            This would be a great bug to report on github. The problem is that the contract binder does not unroll generics, so you end up with multiple services on the same names, with the .NET generic placeholder (but different APIs internally):

            Source https://stackoverflow.com/questions/61727870

            QUESTION

            protobuf-net.grpc client and .NET Core's gRPC client factory integration
            Asked 2020-Mar-26 at 14:54

            I am experimenting with a gRPC service and client using proto files. The advice is to use gRPC client factory integration in .NET Core (https://docs.microsoft.com/en-us/aspnet/core/grpc/clientfactory?view=aspnetcore-3.1). To do this you register the client derived from Grpc.Core.ClientBase that is generated by the Grpc.Tools package, like this:

            ...

            ANSWER

            Answered 2020-Mar-26 at 14:54

            Note that you don't need the AllowUnencryptedHttp2 - that's just if you aren't using https, but: you seem to be using https.

            On the "similarly"; that should already work - the only bit you might be missing is the call to services.AddCodeFirstGrpc() (usually in Startup.cs, via ConfigureServices).

            As for the AddGrpcClient; I would have to investigate. That isn't something that I've explored in the integrations so far. It might be a new piece is needed.

            Source https://stackoverflow.com/questions/60869533

            QUESTION

            Client callbacks with protobuf-net.Grpc
            Asked 2020-Feb-26 at 22:31

            I'm currently working on replacing an old WCF client/server pairing with gRpc, and decided to use protobuf-net.Grpc as we've used protobuf-net extensively elsewhere in our codebase. I'm running into a bit of trouble with one particular portion however.

            Part of the original service is a Subscribe method which uses IClientCallback to effectively send an event to the client. Looking at regular gRpc, it seems like this would be possible (though a bit hacky) using a server streaming method and storing the IServerStreamWriter object on the server, writing to it whenever we wanted to "fire an event".

            For the life of me, however, I can't quite figure out how to do something similar in protobuf-net.Grpc with the IAsyncEnumerable return type. The closest I can figure is using Task.Wait in a loop and updating some shared collection when I want to "fire" the event, which the loop would then check for and yield return. This doesn't seem like it'd scale well, however, and there isn't really a great way to definitely unsubscribe when a client is no longer listening to events.

            Is there some other/better way to do this?

            ...

            ANSWER

            Answered 2020-Feb-26 at 22:31

            Channel, which can be tweaked via AsAsyncEnumerable() - which then essentially acts as a queue at the producer side, and a sequence at the consumer.

            Source https://stackoverflow.com/questions/60420393

            QUESTION

            How to use IAsyncEnumerable within a message in protobuf-net.grpc?
            Asked 2020-Feb-01 at 14:23

            So, recently I learned about how to do streaming with protobuf-net.grpc with the help of IAsyncEnumerable. This all works fine and dandy, but I'm facing a bit of an issue right now.

            For some of my calls, I'd like to call with both some metadata as well as the stream as parameter.

            For example:

            ...

            ANSWER

            Answered 2020-Feb-01 at 14:23

            There are two separate concepts here:

            • gRPC allows a stream of messages via IAsyncEnumerable (instead of a Task for a single message)
            • however, each individual message must be complete and self contained; the marshaller (per-message serializer) is synchronous only

            So: you can use IAsyncEnunerable as the parameter or return of a service method, but not as a field on a message.

            If you need to provide a stream and additional metadata a few options exist:

            • use http headers (via CallContext as a second parameter)
            • have two service calls - one that initiates things and gets the metadata, one that returns the stream
            • have a stream with some optional fields in the message, and only populate the optional fields in the first or last message

            Source https://stackoverflow.com/questions/60017558

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install protobuf-net.Grpc

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/protobuf-net/protobuf-net.Grpc.git

          • CLI

            gh repo clone protobuf-net/protobuf-net.Grpc

          • sshUrl

            git@github.com:protobuf-net/protobuf-net.Grpc.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular C# Libraries

            PowerToys

            by microsoft

            shadowsocks-windows

            by shadowsocks

            PowerShell

            by PowerShell

            aspnetcore

            by dotnet

            v2rayN

            by 2dust

            Try Top Libraries by protobuf-net

            protobuf-net

            by protobuf-netC#

            protobuf-net.ToolsDemo

            by protobuf-netC#

            protobuf-net.GrpcLite

            by protobuf-netC#