add fast open support in server
This commit is contained in:
parent
fd6a0a8af0
commit
f6a9cad684
1 changed files with 5 additions and 0 deletions
|
@ -400,6 +400,11 @@ class TCPRelay(object):
|
||||||
server_socket.bind(sa)
|
server_socket.bind(sa)
|
||||||
server_socket.setblocking(False)
|
server_socket.setblocking(False)
|
||||||
server_socket.listen(1024)
|
server_socket.listen(1024)
|
||||||
|
if config['fast_open']:
|
||||||
|
try:
|
||||||
|
server_socket.setsockopt(socket.SOL_TCP, 23, 5)
|
||||||
|
except socket.error:
|
||||||
|
logging.error('warning: fast open is not available')
|
||||||
self._server_socket = server_socket
|
self._server_socket = server_socket
|
||||||
|
|
||||||
def add_to_loop(self, loop):
|
def add_to_loop(self, loop):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue