We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4fd7ff5 + e8f09c2 commit e2f9b01Copy full SHA for e2f9b01
1 file changed
src/class_receiveDataThread.py
@@ -66,7 +66,10 @@ def run(self):
66
shared.printLock.release()
67
while True:
68
try:
69
+ dataLen = len(self.data)
70
self.data += self.sock.recv(4096)
71
+ if len(self.data) == dataLen: # recv returns 0 bytes when the remote closes the connection
72
+ raise Exception("Remote closed the connection")
73
except socket.timeout:
74
shared.printLock.acquire()
75
print 'Timeout occurred waiting for data from', self.HOST + '. Closing receiveData thread. (ID:', str(id(self)) + ')'
0 commit comments