Commit e9231a5f authored by Toby Dickenson's avatar Toby Dickenson

turn on TCP_NODELAY, in both directions. This avoids latency when a request or...

turn on TCP_NODELAY, in both directions. This avoids latency when a request or response doesnt fit in one packet. ZEO is already doing its best to buffer data before calling send, so TCP_NODELAY can do little harm
parent 2a862819
......@@ -262,6 +262,7 @@ class ConnectThread(threading.Thread):
domain, err), level=zLOG.ERROR)
continue
s.setblocking(0)
s.setsockopt(socket.IPPROTO_TCP, 1, 1) # TCP_NODELAY
self.sockets[s] = addr
# connect() raises Connected iff it succeeds
# XXX can still block for a while if addr requires DNS
......
......@@ -41,6 +41,7 @@ class Dispatcher(asyncore.dispatcher):
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
else:
self.create_socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.setsockopt(socket.IPPROTO_TCP, 1, 1) # TCP_NODELAY
self.set_reuse_addr()
log("listening on %s" % str(self.addr))
self.bind(self.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