mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Use SO_REUSEPORT if available (#1344)
This commit is contained in:
parent
1853071dc2
commit
bfc807ac1e
@ -38,6 +38,8 @@ class BaseSocket(object):
|
||||
|
||||
def set_options(self, sock, bound=False):
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
||||
if hasattr(socket, 'SO_REUSEPORT'):
|
||||
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
|
||||
if not bound:
|
||||
self.bind(sock)
|
||||
sock.setblocking(0)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user