Ability to write own transport layer in C#

43 views
Skip to first unread message

mika...@gmail.com

unread,
Jan 20, 2020, 12:28:28 PM1/20/20
to grpc.io
Hello !
I am looking for possibility to write custom 'channel' of communication in C#. I need to use grpc over something else than HTTP. Is there any possibility to write own Server ? I found that there is ChannelBase class but I could not find anything like that for Server class.

Mikart

Nicolas Noble

unread,
Jan 22, 2020, 11:06:22 PM1/22/20
to mika...@gmail.com, grpc.io
We currently do not have any pluggable transport layer exposed, no. 

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/0a13d2fc-6ca4-4a4b-a9b9-190295670066%40googlegroups.com.

Jan Tattermusch

unread,
Jan 23, 2020, 6:12:26 AM1/23/20
to grpc.io
Out of curiosity, what transport layer are you interested in?

The simple answer is no, this is not possible in C#.

A longer answer is there are 2 theoretical possibilities, but unless you're ready to basically maintain your own fork of gRPC, I certainly wouldn't recommend any of them:
1. you could write your own transport layer in C/C++ (expert level stuff), add it to C-core library and use it from the C# wrapping layer (after building your own custom nuget)
2. you could use Grpc.Core.Api to implement the gRPC C# public API yourself and create a custom C# "channel" that will do whatever you want. (this is basically what the grpc/grpc-dotnet project has done). Note that this approach basically means you're rewriting the entire gRPC implementation yourself, so definitely not recommended.

mika...@gmail.com

unread,
Jan 28, 2020, 3:53:19 PM1/28/20
to grpc.io
I want to make it work with serial port to communicate with my academic project
Reply all
Reply to author
Forward
0 new messages