def testStopTrying(self):
f = Factory()
f.protocol = In
f.connections = 0
f.allMessages = []
f.goal = 2
f.d = defer.Deferred()
c = ReconnectingClientFactory()
c.initialDelay = c.delay = 0.2
c.protocol = Out
c.howManyTimes = 2
port = self.port = reactor.listenTCP(0, f)
PORT = port.getHost().port
reactor.connectTCP('127.0.0.1', PORT, c)
f.d.addCallback(self._testStopTrying_1, f, c)
return f.d
评论列表
文章目录