From 0b78e3663917d293c4ec895d55b57191910d7eef Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Tue, 30 Apr 2013 10:54:30 -0400 Subject: [PATCH] added extra statements for troubleshooting --- src/bitmessagemain.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index ab9a134d..a806627f 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -260,25 +260,25 @@ class receiveDataThread(QThread): def run(self): printLock.acquire() - print 'The size of the connectedHostsList is now', len(connectedHostsList) + print 'ID of the receiveDataThread is', str(id(self))+'. The size of the connectedHostsList is now', len(connectedHostsList) printLock.release() while True: try: self.data += self.sock.recv(4096) except socket.timeout: printLock.acquire() - print 'Timeout occurred waiting for data. Closing receiveData thread.' + print 'Timeout occurred waiting for data from', self.HOST + '. Closing receiveData thread. (ID:',str(id(self))+ ')' printLock.release() break except Exception, err: printLock.acquire() - print 'sock.recv error. Closing receiveData thread.', err + print 'sock.recv error. Closing receiveData thread (HOST:', self.HOST, 'ID:',str(id(self))+ ').', err printLock.release() break #print 'Received', repr(self.data) if self.data == "": printLock.acquire() - print 'Connection closed. Closing receiveData thread.' + print 'Connection to', self.HOST, 'closed. Closing receiveData thread. (ID:',str(id(self))+ ')' printLock.release() break else: @@ -2003,7 +2003,7 @@ class sendDataThread(QThread): self.lastTimeISentData = int(time.time()) #If this value increases beyond five minutes ago, we'll send a pong message to keep the connection alive. self.objectsOfWhichThisRemoteNodeIsAlreadyAware = objectsOfWhichThisRemoteNodeIsAlreadyAware printLock.acquire() - print 'The streamNumber of this sendDataThread (ID:', id(self),') at setup() is', self.streamNumber + print 'The streamNumber of this sendDataThread (ID:', str(id(self))+') at setup() is', self.streamNumber printLock.release() def sendVersionMessage(self): @@ -2068,7 +2068,7 @@ class sendDataThread(QThread): self.sock.shutdown(socket.SHUT_RDWR) self.sock.close() sendDataQueues.remove(self.mailbox) - print 'sendDataThread thread', self, 'ending now' + print 'sendDataThread thread (ID:',str(id(self))+') ending now. Was connected to', self.HOST break elif command == 'sendinv': if data not in self.objectsOfWhichThisRemoteNodeIsAlreadyAware: @@ -2088,7 +2088,7 @@ class sendDataThread(QThread): self.sock.shutdown(socket.SHUT_RDWR) self.sock.close() sendDataQueues.remove(self.mailbox) - print 'sendDataThread thread', self, 'ending now' + print 'sendDataThread thread (ID:',str(id(self))+') ending now. Was connected to', self.HOST break elif command == 'pong': if self.lastTimeISentData < (int(time.time()) - 298): @@ -2100,11 +2100,11 @@ class sendDataThread(QThread): self.sock.sendall('\xE9\xBE\xB4\xD9\x70\x6F\x6E\x67\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcf\x83\xe1\x35') self.lastTimeISentData = int(time.time()) except: - print 'self.sock.send pong failed' + print 'send pong failed' self.sock.shutdown(socket.SHUT_RDWR) self.sock.close() sendDataQueues.remove(self.mailbox) - print 'sendDataThread thread', self, 'ending now' + print 'sendDataThread thread', self, 'ending now. Was connected to', self.HOST break else: printLock.acquire()