示例#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()
示例#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()
示例#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)
示例#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)
示例#5
0
 def clientConnectionLost(self, connector, reason):
     ReconnectingPBClientFactory.clientConnectionLost(
         self, connector, reason)
     self.source.connected = False
示例#6
0
 def stopFactory(self):
     ReconnectingPBClientFactory.stopFactory(self)
     self.stopTimers()
示例#7
0
 def clientConnectionLost(self, connector, reason):
     self.connector = None
     self.stopTimers()
     self.perspective = None
     ReconnectingPBClientFactory.clientConnectionLost(self,
                                                      connector, reason)
示例#8
0
 def clientConnectionFailed(self, connector, reason):
     self.connector = None
     ReconnectingPBClientFactory.clientConnectionFailed(self,
                                                        connector, reason)
示例#9
0
 def startedConnecting(self, connector):
     ReconnectingPBClientFactory.startedConnecting(self, connector)
     self.connector = connector
示例#10
0
 def __init__(self, keepaliveInterval, keepaliveTimeout, maxDelay):
     ReconnectingPBClientFactory.__init__(self)
     self.maxDelay = maxDelay
     self.keepaliveInterval = keepaliveInterval
     self.keepaliveTimeout = keepaliveTimeout
示例#11
0
 def clientConnectionLost(self, connector, reason):
     ReconnectingPBClientFactory.clientConnectionLost(self, connector,
                                                      reason)
     self.source.connected = False