Add TCP_NODELAY

This commit is contained in:
Jason Paryani
2013-12-11 22:25:43 -08:00
parent 1620965aee
commit 2f0f03d1a8
2 changed files with 15 additions and 6 deletions

View File

@@ -285,4 +285,8 @@ if __name__ == '__main__':
host, port = parse_args().host.split(':')
sock = socket.create_connection((host, port))
# Set TCP_NODELAY on socket to disable Nagle's algorithm. This is not
# neccessary, but it speeds things up.
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
main(sock)