[Python-ideas] Unify addresses passed to bind() and getaddrinfo()
g.rodola at gmail.com
Mon Mar 11 20:20:28 CET 2013
...when using bind():
HOST = "" # Symbolic name meaning all available interfaces
...when using getaddrinfo():
HOST = None # Symbolic name meaning all available interfaces
I recently got bitten by this difference in that I passed "" (empy
string) to getaddrinfo() and since my DNS server was temporarily down
getaddrinfo() hung indefinitely (cset where I fixed this:
It took me quite some time to figure out what was wrong as to me ""
has always been an alias for "all interfaces" and didn't know
getaddrinfo() behaved differently than bind() in this regard.
If from getaddrinfo() standpoint "" (empty string) has no particular
meaning I propose to unify the two APIs and make getaddrinfo() assume
"" is an alias for "all interfaces".
More information about the Python-ideas