Skip to content
Snippets Groups Projects
Commit 2fc39895 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

added more commands for standalone mode

parent a7a58987
No related branches found
No related tags found
No related merge requests found
......@@ -249,14 +249,16 @@ sub main
print join(' ', scalar localtime(time()), $channel, $msg), "\n";
}
if ($stdin->can_read(0.5))
if ($stdin->can_read(0.2))
{
my $l= <STDIN>; chop($l);
my ($cmd, $channel, $msg)= split(' ', $l, 3);
if ($cmd eq 'announce')
{
$fanout->announce($channel, $msg);
}
if ($cmd eq 'announce') { $fanout->announce($channel, $msg); }
elsif ($cmd eq 'ping') { $fanout->send("ping\n"); }
elsif ($cmd eq 'info') { $fanout->send("info\n"); }
elsif ($cmd eq 'subscribe') { $fanout->subscribe($channel); }
elsif ($cmd eq 'unsubscribe') { $fanout->unsubscribe($channel); }
else { print "unknown command '$cmd'\n"; }
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment