Explorar o código

*** empty log message ***

Jesse Schell %!s(int64=25) %!d(string=hai) anos
pai
achega
3dbb4bd24a
Modificáronse 1 ficheiros con 9 adicións e 0 borrados
  1. 9 0
      direct/src/distributed/ClientRepository.py

+ 9 - 0
direct/src/distributed/ClientRepository.py

@@ -70,6 +70,7 @@ class ClientRepository(DirectObject.DirectObject):
         return Task.cont
 
     def readerPollOnce(self):
+        self.ensureValidConnection()
         availGetVal = self.qcr.dataAvailable()
         if availGetVal:
             #print "Client: Incoming message!"
@@ -81,6 +82,14 @@ class ClientRepository(DirectObject.DirectObject):
                 ClientRepository.notify.warning("getData returned false")
         return availGetVal
 
+    def ensureValidConnection(self):
+        # Was the connection reset?
+        if self.qcm.resetConnectionAvailable():
+            resetConnectionPointer = PointerToConnection()
+            if self.qcm.getResetConnection(resetConnectionPointer):
+                self.fsm.request("noConnection")
+        return None
+
     def handleDatagram(self, datagram):
         # This class is meant to be pure virtual, and any classes that
         # inherit from it need to make their own handleDatagram method