Commit 5114f909 authored by Julien Muchembled's avatar Julien Muchembled Committed by Kirill Smelkov

[ZEO4] Enable TCP_NODELAY for inet(6) sockets

See commit 3d886d42.

----

Originally included in slapos: slapos@5cf4cf1f
parent eb1cd547
...@@ -568,6 +568,8 @@ class ConnectWrapper: ...@@ -568,6 +568,8 @@ class ConnectWrapper:
self.close() self.close()
return return
self.sock.setblocking(0) self.sock.setblocking(0)
if domain in (socket.AF_INET, socket.AF_INET6):
self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
self.state = "opened" self.state = "opened"
def connect_procedure(self): def connect_procedure(self):
......
...@@ -66,6 +66,7 @@ class Dispatcher(asyncore.dispatcher): ...@@ -66,6 +66,7 @@ class Dispatcher(asyncore.dispatcher):
socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, True) socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, True)
else: else:
self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
else: else:
self.create_socket(socket.AF_UNIX, socket.SOCK_STREAM) self.create_socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.set_reuse_addr() self.set_reuse_addr()
......
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