Is it possible to share a UDP socket between server and client? #1606
-
So I like to use the same socket between server and client operations so that I can usually detect WAN accessible port for a user-client to connect to. Pool exists somewhere remote. This doesn't always work of course, there are lots of edge cases, but it works pretty well most of the time. Can this be done? I was reading on the lsquic, how somehow this isn't possible because of some mess up in a previous google version of quic, but maybe it's possible here? I'm unclear of the state of this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
It is almost possible to share the socket, but due to some protocol complexities around how you look up the connection from the packet header during the handshake, server and client are unfortunately mutually exclusive. Post handshake they could theoretically share, but obviously you have to get through the handshake first. If you're interested in the nitty-gritty details, let me know and I will see about adding them later. Edit: BTW, MsQuic used to support sharing until I discovered the edge case bug for which the fix required them to be exclusive. |
Beta Was this translation helpful? Give feedback.
It is almost possible to share the socket, but due to some protocol complexities around how you look up the connection from the packet header during the handshake, server and client are unfortunately mutually exclusive. Post handshake they could theoretically share, but obviously you have to get through the handshake first. If you're interested in the nitty-gritty details, let me know and I will see about adding them later.
Edit: BTW, MsQuic used to support sharing until I discovered the edge case bug for which the fix required them to be exclusive.