Upon incoming connection, start the sendData thread before the receiveData thread

This commit is contained in:
Jonathan Warren 2013-05-07 16:25:01 -04:00
parent 4b27e07c2c
commit 3ab48c2fe3
1 changed files with 8 additions and 8 deletions

View File

@ -210,20 +210,20 @@ class singleListener(threading.Thread):
print 'incoming connection is from a host in shared.connectedHostsList (we are already connected to it). Ignoring it.'
a.close()
a,(HOST,PORT) = sock.accept()"""
rd = receiveDataThread()
rd.daemon = True # close the main program even if there are threads left
#self.emit(SIGNAL("passObjectThrough(PyQt_PyObject)"),rd)
objectsOfWhichThisRemoteNodeIsAlreadyAware = {}
rd.setup(a,HOST,PORT,-1,objectsOfWhichThisRemoteNodeIsAlreadyAware)
shared.printLock.acquire()
print self, 'connected to', HOST,'during INCOMING request.'
shared.printLock.release()
rd.start()
sd = sendDataThread()
sd.setup(a,HOST,PORT,-1,objectsOfWhichThisRemoteNodeIsAlreadyAware)
sd.start()
rd = receiveDataThread()
rd.daemon = True # close the main program even if there are threads left
rd.setup(a,HOST,PORT,-1,objectsOfWhichThisRemoteNodeIsAlreadyAware)
rd.start()
shared.printLock.acquire()
print self, 'connected to', HOST,'during INCOMING request.'
shared.printLock.release()
#This thread is created either by the synSenderThread(for outgoing connections) or the singleListenerThread(for incoming connectiosn).
class receiveDataThread(threading.Thread):