Restore the connection

5 views
Skip to first unread message

Teplov

unread,
Jul 27, 2009, 5:30:01 AM7/27/09
to perl-net-jabber-bot
Hello!

I'm using Net::Jabber::Bot 2.1.4 in my project. But I can't do my bot
to restore the connection.
This is what I get in the logs:

2009/07/25 12:56:03 Disconnecting from server
2009/07/25 12:56:03 REF =
2009/07/25 12:56:03 Disconnected from xmpp.******.***:5222 as
d74fa473c3787a2670e41f8316bf6751 Reconnecting...
2009/07/25 12:56:08 Disconnecting from server
2009/07/25 12:56:08 REF =
2009/07/25 12:56:08 Disconnected from xmpp.******.***:5222 as
d74fa473c3787a2670e41f8316bf6751 Reconnecting...
2009/07/25 12:56:13 Disconnecting from server
2009/07/25 12:56:13 REF =
2009/07/25 12:56:14 Disconnected from xmpp.******.***:5222 as
d74fa473c3787a2670e41f8316bf6751 Reconnecting...

It is suspected that the method ReconnectToServer() does not work.

sub ReconnectToServer {
my $self = shift;

my $background_subroutine = $self->background_function;

$self->Disconnect();

my $sleep_time = 5;
while (!$self->IsConnected()) { # jabber_client variable defines
if we're connected.
INFO("Sleeping $sleep_time before attempting re-connect");
sleep $sleep_time;
$sleep_time *= 2 if($sleep_time < 300);
$self->InitJabber();
INFO("Running background routine.");
&$background_subroutine($self, 0); # call background proc so
we can check for errors while down.
}
}

Help please, what could be the problem?

Todd Rinaldo

unread,
Jul 28, 2009, 9:49:29 AM7/28/09
to perl-net-...@googlegroups.com
I'm having the same trouble. I'll check it out later on this week and
provide a fix. The feature used to work. Now it's just pounding on the
server when it goes into this loop.
Reply all
Reply to author
Forward
0 new messages