Skip to content

Commit

Permalink
add TCP_NODELAY
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Dec 30, 2012
1 parent 480c9ec commit e8454cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions local.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ def handle(self):
remote = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
else:
remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
remote.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
remote.connect((SERVER, REMOTE_PORT))
self.send_encrypt(remote, addr_to_send)
logging.info('connecting %s:%d' % (addr, port[0]))
Expand Down
1 change: 1 addition & 0 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def handle(self):
try:
logging.info('connecting %s:%d' % (addr, port[0]))
remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
remote.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
remote.connect((addr, port[0]))
except socket.error, e:
# Connection refused
Expand Down

0 comments on commit e8454cf

Please sign in to comment.