Use 10s timeout while establishing new connections

This commit is contained in:
TheKysek 2016-10-17 19:32:20 +02:00
parent 1a42876521
commit a4f5532f94

View File

@ -115,7 +115,7 @@ class Connection(threading.Thread):
logging.debug('Connecting to {}:{}'.format(self.host, self.port)) logging.debug('Connecting to {}:{}'.format(self.host, self.port))
try: try:
self.s = socket.create_connection((self.host, self.port)) self.s = socket.create_connection((self.host, self.port), 10)
self.status = 'connected' self.status = 'connected'
logging.info('Established TCP connection to {}:{}'.format(self.host, self.port)) logging.info('Established TCP connection to {}:{}'.format(self.host, self.port))
except Exception as e: except Exception as e: