|
|
|
@ -15,17 +15,16 @@ import protocol
|
|
|
|
|
import state
|
|
|
|
|
|
|
|
|
|
class ReceiveQueueThread(threading.Thread, StoppableThread):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
threading.Thread.__init__(self, name="ReceiveQueueThread")
|
|
|
|
|
def __init__(self, num=0):
|
|
|
|
|
threading.Thread.__init__(self, name="ReceiveQueue_%i" %(num))
|
|
|
|
|
self.initStop()
|
|
|
|
|
self.name = "ReceiveQueueThread"
|
|
|
|
|
logger.info("init receive queue thread")
|
|
|
|
|
self.name = "ReceiveQueue_%i" % (num)
|
|
|
|
|
logger.info("init receive queue thread %i", num)
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
while not self._stopped and state.shutdown == 0:
|
|
|
|
|
try:
|
|
|
|
|
dest = receiveDataQueue.get(block=True, timeout=1)
|
|
|
|
|
receiveDataQueue.task_done()
|
|
|
|
|
except Queue.Empty:
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
@ -44,3 +43,4 @@ class ReceiveQueueThread(threading.Thread, StoppableThread):
|
|
|
|
|
# AttributeError = state isn't implemented
|
|
|
|
|
except (KeyError, AttributeError):
|
|
|
|
|
pass
|
|
|
|
|
receiveDataQueue.task_done()
|
|
|
|
|