From b56f9fb7612d5ab32c2a77fa47ef012b447b4be6 Mon Sep 17 00:00:00 2001 From: yvesf Date: Mon, 7 Dec 2009 08:22:55 +0000 Subject: foobar git-svn-id: http://xapek.org/svn/common/omegle@1477 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd --- icq_roombot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'icq_roombot.py') diff --git a/icq_roombot.py b/icq_roombot.py index 7dc3da9..835d639 100644 --- a/icq_roombot.py +++ b/icq_roombot.py @@ -186,15 +186,20 @@ class ReconnectingOSCARFactory(protocol.ClientFactory): return p def clientConnectionLost(self, connector, reason): + print "reconnect in %s" % self.delay reactor.callLater(self.delay, self._reconnect) def _reconnect(self): + print "reconnect" f = ReconnectingOSCARLoginFactory(uin, password) return reactor.connectTCP(host, port, f) class OscarCrap( oscar.OscarAuthenticator ): BOSClass = icqBot connectfactory = ReconnectingOSCARFactory + def connectToBOS(self, server, port): + f = self.connectfactory(self.username, self.cookie) + return reactor.connectTCP(server, int(port), f) class ReconnectingOSCARLoginFactory(protocol.ReconnectingClientFactory): protocol = OscarCrap @@ -214,4 +219,3 @@ if __name__ == '__main__': f = ReconnectingOSCARLoginFactory(uin, password) reactor.connectTCP(host, port, f) reactor.run() - -- cgit v1.2.1