catch exception when client is disconnected

This commit is contained in:
thomasv 2012-10-22 14:56:59 +02:00
parent 8e95706763
commit 4038b81a22
1 changed files with 7 additions and 2 deletions

View File

@ -295,8 +295,13 @@ class Interface(threading.Thread):
self.message_id += 1
out += request + '\n'
while out:
sent = self.s.send( out )
out = out[sent:]
try:
sent = self.s.send( out )
out = out[sent:]
except:
# this happens when we get disconnected
print "Not connected, cannot send"
return None
return ids