Commit 3555cfe8 authored by Denis Bilenko's avatar Denis Bilenko

baseserver: include address we tried to bind on in the error message

parent 095863bd
...@@ -202,7 +202,13 @@ def _tcp_listener(address, backlog=50, reuse_addr=None): ...@@ -202,7 +202,13 @@ def _tcp_listener(address, backlog=50, reuse_addr=None):
sock = _socket.socket() sock = _socket.socket()
if reuse_addr is not None: if reuse_addr is not None:
sock.setsockopt(_socket.SOL_SOCKET, _socket.SO_REUSEADDR, reuse_addr) sock.setsockopt(_socket.SOL_SOCKET, _socket.SO_REUSEADDR, reuse_addr)
sock.bind(address) try:
sock.bind(address)
except _socket.error, ex:
strerror = getattr(ex, 'strerror', None)
if strerror is not None:
ex.strerror = strerror + ': ' + repr(address)
raise
sock.listen(backlog) sock.listen(backlog)
sock.setblocking(0) sock.setblocking(0)
return sock return sock
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment