aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-07-26 22:22:26 +1200
committerDavid Phillips <david@sighup.nz>2017-07-26 22:22:26 +1200
commit80af35e960b379d4aea5166ba51d77a2142ab491 (patch)
tree0e754b4e4d9d9afdd0d23b32b0bbb4ee7baee88c
parente258d5a64d837681fbb870943c8a191d7ffd626c (diff)
downloadidalius-80af35e960b379d4aea5166ba51d77a2142ab491.tar.xz
Detect socket and IRC errors, reconnect upon them
-rwxr-xr-xidalius.pl12
1 files changed, 11 insertions, 1 deletions
diff --git a/idalius.pl b/idalius.pl
index ef157ec..151e61c 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -52,7 +52,9 @@ POE::Session->create(
irc_public
irc_msg
irc_nick
- irc_disconnected ) ],
+ irc_disconnected
+ irc_error
+ irc_socketerr) ],
],
heap => { irc => $irc },
);
@@ -194,6 +196,14 @@ sub irc_disconnected {
$irc->yield(connect => { });
}
+sub irc_error {
+ $irc->yield(connect => { });
+}
+
+sub irc_socketerr {
+ $irc->yield(connect => { });
+}
+
sub _default {
my ($event, $args) = @_[ARG0 .. $#_];
my @output = ( "$event: " );