Using UDP in gRPC

Viewed 5703

Is it possible to use Protobuf with UDP in gRPC?

The gRPC interface seems to be entirely based on TCP connections. The only example for UDP that I could find is the one in the gRPC source code in the following three files , but this example seems to be quite different than what gRPC's RPC layer offers, for example it has no notion of stubs, and it doesn't use Protobuf and instead use raw payload, etc.

src/core/lib/iomgr/udp_server.h

src/core/lib/iomgr/udp_server.cc

test/core/iomgr/udp_server_test.cc

2 Answers

July 9th, 2015 (grpc-go#241)

No, we need a reliable channel and UDP is not supported. There has been discussion with playing with things like QUIC, but we aren't currently trying it out and it would be even longer before we decided whether we would support it.

May 15th, 2018 (grpc#9493)

Closing this - we have no plan to support unreliable packets at the moment. If we have any particular protocol that can fit the use cases listed above, we will probably do a grfc first..

August 6th, 2018 (grpc-go#241)

We are working on new interface/abstractions between the grpc & transport packages to make it possible for custom transports (UDP could be one of them) to be implemented.

Incidentally, Cap'n Proto has UDP on their roadmap. I thought it was a joke at first, but it's real (...unless I'm still being trolled ), and written by the original author of proto2 at Google

Sorry, UDP support in gRPC is not enabled. As you observed, there is no way to actually access the limited udp support that currently exists. I do not know when or if this will change.

Related