Ejemplo n.º 1
0
 def gotPerspective(self, perspective):
     ReconnectingPBClientFactory.gotPerspective(self, perspective)
     self.perspective = perspective
     try:
         perspective.broker.transport.setTcpKeepAlive(1)
     except:
         log.msg("unable to set SO_KEEPALIVE")
         if not self.keepaliveInterval:
             self.keepaliveInterval = 10 * 60
     self.activity()
     if self.keepaliveInterval:
         log.msg("sending application-level keepalives every %d seconds" % self.keepaliveInterval)
         self.startTimers()
Ejemplo n.º 2
0
 def gotPerspective(self, perspective):
     ReconnectingPBClientFactory.gotPerspective(self, perspective)
     self.perspective = perspective
     try:
         perspective.broker.transport.setTcpKeepAlive(1)
     except:
         log.msg("unable to set SO_KEEPALIVE")
         if not self.keepaliveInterval:
             self.keepaliveInterval = 10*60
     self.activity()
     if self.keepaliveInterval:
         log.msg("sending application-level keepalives every %d seconds" \
                 % self.keepaliveInterval)
         self.startTimers()
Ejemplo n.º 3
0
 def gotPerspective(self, perspective):
     log.msg("connected to FreshCVS daemon")
     ReconnectingPBClientFactory.gotPerspective(self, perspective)
     self.source.connected = True
     # TODO: freshcvs-1.0.10 doesn't handle setFilter correctly, it will
     # be fixed in the upcoming 1.0.11 . I haven't been able to test it
     # to make sure the failure mode is survivable, so I'll just leave
     # this out for now.
     return
     if self.source.prefix is not None:
         pathfilter = "^%s" % self.source.prefix
         d = perspective.callRemote("setFilter", None, pathfilter, None)
         # ignore failures, setFilter didn't work in 1.0.10 and this is
         # just an optimization anyway
         d.addErrback(lambda f: None)
Ejemplo n.º 4
0
 def gotPerspective(self, perspective):
     log.msg("connected to FreshCVS daemon")
     ReconnectingPBClientFactory.gotPerspective(self, perspective)
     self.source.connected = True
     # TODO: freshcvs-1.0.10 doesn't handle setFilter correctly, it will
     # be fixed in the upcoming 1.0.11 . I haven't been able to test it
     # to make sure the failure mode is survivable, so I'll just leave
     # this out for now.
     return
     if self.source.prefix is not None:
         pathfilter = "^%s" % self.source.prefix
         d = perspective.callRemote("setFilter",
                                    None, pathfilter, None)
         # ignore failures, setFilter didn't work in 1.0.10 and this is
         # just an optimization anyway
         d.addErrback(lambda f: None)
Ejemplo n.º 5
0
 def clientConnectionLost(self, connector, reason):
     ReconnectingPBClientFactory.clientConnectionLost(
         self, connector, reason)
     self.source.connected = False
Ejemplo n.º 6
0
 def stopFactory(self):
     ReconnectingPBClientFactory.stopFactory(self)
     self.stopTimers()
Ejemplo n.º 7
0
 def clientConnectionLost(self, connector, reason):
     self.connector = None
     self.stopTimers()
     self.perspective = None
     ReconnectingPBClientFactory.clientConnectionLost(self,
                                                      connector, reason)
Ejemplo n.º 8
0
 def clientConnectionFailed(self, connector, reason):
     self.connector = None
     ReconnectingPBClientFactory.clientConnectionFailed(self,
                                                        connector, reason)
Ejemplo n.º 9
0
 def startedConnecting(self, connector):
     ReconnectingPBClientFactory.startedConnecting(self, connector)
     self.connector = connector
Ejemplo n.º 10
0
 def __init__(self, keepaliveInterval, keepaliveTimeout, maxDelay):
     ReconnectingPBClientFactory.__init__(self)
     self.maxDelay = maxDelay
     self.keepaliveInterval = keepaliveInterval
     self.keepaliveTimeout = keepaliveTimeout
Ejemplo n.º 11
0
 def clientConnectionLost(self, connector, reason):
     ReconnectingPBClientFactory.clientConnectionLost(self, connector,
                                                      reason)
     self.source.connected = False