Charles-François Natali added the comment:

I think that's a good idea.

However, there's a problem with the implementation: if one passes "" or None as 
address on a dual-stack node, the resulting socket will be either IPv4 bound to 
INADDR_ANY, or IPv6 bound to IN6ADDR_ANY, whereas one would expect to be bound 
both in IPv4 and IPv6. In the later case, some platforms (like Linux) use 
IPv4-mapped addresses by default, some others (e.g. some versions of FreeBSD) 
don't. So, depending on IPV6_V6ONLY setting, binding to IPV6 any won't accept 
IPv4 connections. Also, some platforms don't support mapped addresses at all, 
so the only portable solution is to bind both to 0.0.0.0 and ::, whith two 
different sockets, and use select() to accept both.

So it would maybe make sense to expose a ServerSocket class, with an accept 
method which would do the right thing (as an added bonus, it could expose 
set_reuse_addr(bool), since SO_REUSEADDR have subtle semantic differences 
between Unix and Windows).

----------
nosy: +neologix

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17561>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to