/usr/share/doc/libpoe-component-ikc-perl/examples/client5 is in libpoe-component-ikc-perl 0.2305-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #!/usr/bin/perl -w
use strict;
use lib qw(blib/lib blib/arch);
use POE qw(Session);
use POE::Component::IKC::Client;
my $name="Client$$";
### Send a request to the time-server
sub server_io
{
my($kernel, $msg)=@_;
}
### Called when we connect to the time server
sub create_me
{
print "Creating session...\n";
POE::Session->new(
_start=>sub
{
my($kernel)=$_[KERNEL];
warn "_start";
$kernel->sig('USR1', 'hup');
$kernel->alias_set('me');
$kernel->post('poe://*/timeserver', 'connect',
"poe://$name/me/pulse");
$kernel->post('IKC', 'publish', 'me', [qw(pulse)]);
},
hup=>sub
{
my($kernel)=$_[KERNEL];
print "Got USR1\n";
$kernel->post('poe://Pulse/timeserver', 'disconnect',
"poe://$name/me/pulse");
return 1;
},
# output a . when the pulse is sent
# output a + if it took longer then a second to get from
# the timerserver
pulse=>sub { print ($_[ARG0] eq localtime() ? '.' : '+'); },
);
}
$|++;
create_ikc_client(
port=>31337,
name=>$name,
subscribe=>[qw(poe://*/timeserver)],
on_connect=>\&create_me,
);
print "Running client...\n";
$poe_kernel->run();
|