diff -Naur asyncio.old/base_events.py asyncio/base_events.py --- asyncio.old/base_events.py 2014-04-11 16:13:39.000000000 +0200 +++ asyncio/base_events.py 2015-03-10 20:16:53.676889591 +0100 @@ -542,14 +542,23 @@ if reuse_address is None: reuse_address = os.name == 'posix' and sys.platform != 'cygwin' sockets = [] - if host == '': - host = None - infos = yield from self.getaddrinfo( - host, port, family=family, - type=socket.SOCK_STREAM, proto=0, flags=flags) - if not infos: - raise OSError('getaddrinfo() returned empty list') + if (isinstance(host, str) + or not isinstance(host, collections.Iterable)): + host = [host] + if None in host or '' in host: + # if we bind to all addresses, do not attempt to use specific + # ones (this would cause an "Address already in use" error) + host = [None] + + infos = set() + for h in host: + infos1 = yield from self.getaddrinfo( + h, port, family=family, + type=socket.SOCK_STREAM, proto=0, flags=flags) + if not infos1: + raise OSError('getaddrinfo() returned empty list') + infos.update(infos1) completed = False try: diff -Naur asyncio.old/events.py asyncio/events.py --- asyncio.old/events.py 2014-04-11 16:13:39.000000000 +0200 +++ asyncio/events.py 2015-03-10 20:06:21.600862683 +0100 @@ -199,7 +199,8 @@ If host is an empty string or None all interfaces are assumed and a list of multiple sockets will be returned (most likely - one for IPv4 and another one for IPv6). + one for IPv4 and another one for IPv6). host can also be an + iterable (e.g. list) of hosts to bind to. family can be set to either AF_INET or AF_INET6 to force the socket to use IPv4 or IPv6. If not set it will be determined