Skip to content

Commit

Permalink
skip EXCLUSIVEADDRUSE on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Jun 28, 2012
1 parent 4e152b5 commit 8e2f3b8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tornado/netutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,7 @@ def bind_sockets(port, address=None, family=socket.AF_UNSPEC, backlog=128):
af, socktype, proto, canonname, sockaddr = res
sock = socket.socket(af, socktype, proto)
set_close_exec(sock.fileno())
if os.name == 'nt':
sock.setsockopt(socket.SOL_SOCKET, socket.SO_EXCLUSIVEADDRUSE, 1)
else:
if os.name != 'nt':
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
if af == socket.AF_INET6:
# On linux, ipv6 sockets accept ipv4 too by default,
Expand Down

0 comments on commit 8e2f3b8

Please sign in to comment.