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
Supply dual-stack (IPv4/IPv6) socket bind routine #69853
Comments
When binding to a socket for creating a service, the socket API provides a mechanism for selecting only IPv4 or IPv6, but the simple operation of binding to all interfaces in a dual-stack environment is not easy, as is revealed in bpo-20215 and bpo-24209, but also in third-party packages. I ran into this during the implementation of aiosmtpd (https://gitlab.com/python-smtpd-hackers/aiosmtpd). As a long time maintainer of CherryPy, I've enjoyed the dual stack support there. I propose the Python stdlib provide a routine to facilitate this need more generally, and then invoke that implementation to address these other use-cases. As it is a new feature, a backports package should be created to supply the same functionality for older Pythons. Would this effort require a PEP? Is there a good place for such a routine (maybe socketserver)? Any other thoughts? |
I don't think it should require a PEP, it looks like a fairly straightforward small enhancement. What is the reason to not put it in the socket module? |
No reason not to put it in the socket module. I was thinking originally that the socket module was C only, but on further reflection, it could easily be one of the "additional facilities implemented in Python". Great suggestion. |
Related though with a different strategy: Tornado's bind_sockets() routine: |
I believe this issue is a duplicate of 17561, which I stumbled onto today. |
As jaraco mentioned, I think this can be closed in favor of #61761 unless we want another solution for UDP specifically (because the |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: