Permalink
Browse files

sleep and retry to reconnect when failed to connect IRC server.

  • Loading branch information...
1 parent 4b565a3 commit 2036a6371dfabb995b039d3e824d491ea82f493c @hirose31 hirose31 committed Feb 21, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 bin/ikachan
View
8 bin/ikachan
@@ -58,10 +58,12 @@ my $create_session; $create_session = sub {
my ($con, $err) = @_;
if (defined $err) {
warn "connect error: $err\n";
- exit 1;
+ sleep 3;
+ $con->disconnect('try reconnect');
+ } else {
+ warn 'connect';
+ $is_connect = 1;
}
- warn 'connect';
- $is_connect = 1;
},
on_disconnect => sub {
warn 'disconnect';

0 comments on commit 2036a63

Please sign in to comment.