Browse Source

default timeout

283
thomasv 13 years ago
parent
commit
a41d3d6a82
  1. 3
      client/interface.py

3
client/interface.py

@ -22,6 +22,7 @@ import random, socket, ast
import thread, traceback, sys, time
DEFAULT_TIMEOUT=5
class Interface:
def __init__(self):
@ -60,7 +61,7 @@ class Interface:
t1 = time.time()
request = repr ( (cmd, params) ) + "#"
s = socket.socket( socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(2)
s.settimeout(DEFAULT_TIMEOUT)
s.connect(( self.host if cmd!='peers' else self.peers_server, self.port) )
s.send( request )
out = ''

Loading…
Cancel
Save