Skip to content

Commit

Permalink
Attempt to reconnect on error in example code (untested)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanko committed Jun 16, 2011
1 parent ec33dc4 commit 4389d0d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions examples/client.pl
@@ -1,6 +1,4 @@
#!/usr/bin/perl -I../lib
use strict;
use warnings;
use AnyEvent;
use AnyEvent::MSN;
use 5.012;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4389d0d

Please sign in to comment.