Browse files

Attempt to reconnect on error in example code (untested)

  • Loading branch information...
1 parent ec33dc4 commit 4389d0da1d8b9529d13d13d9f877e407c5e6ffd9 @sanko committed Jun 16, 2011
Showing with 1 addition and 3 deletions.
  1. +1 −3 examples/client.pl
View
4 examples/client.pl
@@ -1,6 +1,4 @@
#!/usr/bin/perl -I../lib
-use strict;
-use warnings;
use AnyEvent;
use AnyEvent::MSN;
use 5.012;
@@ -30,7 +28,7 @@
on_error => sub {
my ($msn, $msg, $fatal) = @_;
warn ucfirst sprintf '%serror: %s', ($fatal ? 'fatal ' : ''), $msg;
- $cv->send if $fatal;
+ $fatal? $cv->send : $msn->connect
}
);
$cv->recv;

0 comments on commit 4389d0d

Please sign in to comment.