clap-port-flag
clap-port-flag copied to clipboard
UDP sockets
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()
?