Jim Crist-Harif <jcristha...@gmail.com> added the comment:

> I'm not aware of an OS API call that binds both IPv4 and IPv6 to the same 
> random port.

Sure, but `loop.create_server` is already higher-level than a single OS API 
call. 

By default `create_server` will already bind multiple sockets if `host=""`, 
`host=None`, or if `host` is a list. I'm arguing that the current behavior with 
`port=0` in these situations is unexpected. Other libraries (like tornado) have 
come to the same conclusion, and have implemented logic to handle this that 
seems to work well in practice (though can fail, as you've pointed out).

Is there a use case where the current behavior (binding to multiple random 
ports) is desired?

----------

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

Reply via email to