Run initiation under try/except

Ensures that connection is closed if errors occur here.
This commit is contained in:
Tarjei Husøy 2016-06-02 08:56:04 -07:00
parent 40265ebb3e
commit 0a7d73bc83

View file

@ -147,10 +147,9 @@ class ClientConnection(threading.Thread):
def run(self):
self.initiate_client_and_server_connections()
_logger.debug('Initiated')
try:
_logger.debug('Using select to wait for data')
self.initiate_client_and_server_connections()
_logger.debug('Initiated')
while not self.stopped:
timeout = 0
sockets = [self.server_socket, self.socket]