clap-port-flag icon indicating copy to clipboard operation
clap-port-flag copied to clipboard

UDP sockets

Open yoshuawuyts opened this issue 6 years ago • 3 comments

With QUIC becoming a thing, it's reasonable that soon services that traditionally operated over TCP will start operating over UDP. Think HTTP/3 and gRPC.

I'm thinking it might be useful to expose UDP variants of the .bind() and .bind_or() methods, so moving from one protocol to the other doesn't require switching CLI parsers.

I was thinking probably the easiest way is to keep .bind() and .bind_or() operate on TCP, but add the .udp_bind() and .udp_bind_or() methods for UDP connections.

Unresolved questions

  • Is there possibly a better API we could expose? Perhaps with the From trait (if that's not too magicky?).
  • Should we maybe create API symmetry and rename .bind() to .tcp_bind() ?

yoshuawuyts avatar Jul 10 '18 09:07 yoshuawuyts