default timeout

This commit is contained in:
thomasv 2012-02-10 13:14:04 +01:00
parent 96e2a3d7e1
commit a41d3d6a82
1 changed files with 2 additions and 1 deletions

View File

@ -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 = ''