-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add bind_reusable
method to UdpSocket
#21480
Conversation
r? @pcwalton (rust_highfive has picked a reviewer for you, use r? to override) |
I made a similar comment on another PR, but I think that this may be best left off for now. We're actively redesigning the I/O system in a set of new RFCs. Currently one does not exist for We'll try to remember to handle this case as well, as I'm sure you're not the only one wanting this functionality! For now though I'm going to close this while we consider the new I/O system and we hope to have that RFC up soon! |
The new io is here, with no bind_reusable. Should we rebase/refactor this patch ? It would be a shame to freeze the io api with no reusable bind (it makes it impossible to implement things like SSDP and other multicast based protocol). |
Truly, @alexcrichton, I'm forced to support a fork of Rust with the only difference - "bind_reusable" :) |
@kali, @danslapman it is correct that there is currently no method for doing this, but this was explicitly discussed in the RFC. Adding this sort of behavior will likely not be done through a new These sorts of additions are definitely planned for, but are all backwards compatible extensions to the API. An RFC will be required, however, to add this new API as it was not explicitly designed in rust-lang/rfcs#807 |
Ok. Thanks for confirming this is still in the plan, and apologies for missing it in the monster io rfc. |
No worries! Even I often forget what's inside the RFCs... |
This implements
bind_reusable
method for UdpSocket, which binds socket with SO_REUSEADDR set totrue
. Such behaviour is necessary in some cases, such as monitoring multiple multicast streams on the same machine. See also #11758