quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Is it possible to run both the Quic client and server on the same UDP port? #1465

Closed lijunwangs closed 1 year ago

lijunwangs commented 1 year ago

In our application using UDP, the client is sending some UDP messages to the server and the server get the client address (ip:port) and send the responses back to the client where the client is running a packet receiver doing recvfrom as well on the same client address. We are planning to move it to using QUIC for better QOS control.

Is it possible to do the same in the Quinn's quic implementation? i.e. using the same ip:port for the quic server and client on the same node? I am aware that one can use bi-directional streams to send messages in both directions, but that would require significant changes to our programming model. cc @djc

djc commented 1 year ago

Yeah, I believe this should be fine. Connection identifiers are meant to help with this. Just start an Endpoint and connect() and accept() from it?

Ralith commented 1 year ago

"Simultaneous client/server operation" is the first feature called out in the README, yeah.