Skip to content

Commit

Permalink
set timeout on socket
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhaofb committed Jan 14, 2016
1 parent 5ad1d3b commit aa3d11e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions region/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def NewClient(host, port, pool_size):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, int(port)))
_send_hello(s)
s.settimeout(2)
c.sock_pool.append(s)
c.read_lock_pool.append(Lock())
c.write_lock_pool.append(Lock())
Expand Down

0 comments on commit aa3d11e

Please sign in to comment.