mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
REUSEADDR needs to be set before bind()'ing.
This commit is contained in:
parent
aaf848da18
commit
b995b5a672
@ -29,9 +29,9 @@ class BaseSocket(object):
|
||||
return getattr(self.sock, name)
|
||||
|
||||
def set_options(self, sock, bound=False):
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
if not bound:
|
||||
sock.bind(self.address)
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
sock.setblocking(0)
|
||||
sock.listen(2048)
|
||||
return sock
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user