runtime/WampClient.py
changeset 2473 1d64d283d0bd
parent 2471 9d5c291b510f
child 2474 347b03f7e0e8
equal deleted inserted replaced
2472:897687a3c982 2473:1d64d283d0bd
   171     def buildProtocol(self, addr):
   171     def buildProtocol(self, addr):
   172         self.resetDelay()
   172         self.resetDelay()
   173         return ReconnectingClientFactory.buildProtocol(self, addr)
   173         return ReconnectingClientFactory.buildProtocol(self, addr)
   174 
   174 
   175     def clientConnectionFailed(self, connector, reason):
   175     def clientConnectionFailed(self, connector, reason):
   176         if self.continueTrying:
   176         print(_("WAMP Client connection failed (%s) .. retrying ..") %
   177             print(_("WAMP Client connection failed (%s) .. retrying ..") %
   177               time.ctime())
   178                   time.ctime())
   178         super(ReconnectingWampWebSocketClientFactory,
   179             super(ReconnectingWampWebSocketClientFactory,
   179               self).clientConnectionFailed(connector, reason)
   180                   self).clientConnectionFailed(connector, reason)
       
   181         else:
       
   182             del connector
       
   183 
   180 
   184     def clientConnectionLost(self, connector, reason):
   181     def clientConnectionLost(self, connector, reason):
   185         if self.continueTrying:
   182         print(_("WAMP Client connection lost (%s) .. retrying ..") %
   186             print(_("WAMP Client connection lost (%s) .. retrying ..") %
   183               time.ctime())
   187                   time.ctime())
   184         super(ReconnectingWampWebSocketClientFactory,
   188             super(ReconnectingWampWebSocketClientFactory,
   185               self).clientConnectionFailed(connector, reason)
   189                   self).clientConnectionFailed(connector, reason)
       
   190         else:
       
   191             del connector
       
   192 
   186 
   193 
   187 
   194 def CheckConfiguration(WampClientConf):
   188 def CheckConfiguration(WampClientConf):
   195     url = WampClientConf["url"]
   189     url = WampClientConf["url"]
   196     if not IsCorrectUri(url):
   190     if not IsCorrectUri(url):