-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revisit behavior of UDP socket and its connection states #89
Comments
From the UDP man pages and those for connect, send, and recv we can identify the following behaviours of the socket in order to be consistent: When not connected:
When connected:
Both:
Other features which warrant their own issues:
Additionally, there are some race conditions worth paying attention to when working with bind + connect in standard UDP sockets. We should look which apply here. |
Thanks a lot for this detailed investigation, @jpcsmith!
I guess there are two options: (1) Use the state from when |
Regarding the race conditions, they are only applicable if we attempt to support "UDP accept" where we create new connected sockets for peers. This, however, would also require some kind of demultiplexing of incoming packets to the correct socket |
Currently, we can call
connect
repeatedly on a socket even if it already has aremote_address
set. Additionally, we allow callingsend_to(destination)
, even if it is already in a "connected" state.We should decide if we want to change that behavior; e.g., return an
AlreadyConnectedError
when trying to repeatedlyconnect()
.The text was updated successfully, but these errors were encountered: