Subject: | Passing arbitrary data appears broken |
The passing of arbitary data appears to not be working as advertised:
Test Script:
#!/usr/bin/perl
use strict;
use warnings;
use POE qw(Component::Client::Ping);
use Data::Dumper;
$|=1;
my $address = $ARGV[0];
die unless $address;
POE::Component::Client::Ping->spawn( Alias => 'pinger', OneReply => 1 );
POE::Session->create(
package_states => [
'main' => [ qw(_start pong) ],
],
options => { trace => 0 },
);
$poe_kernel->run();
exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
$kernel->post( 'pinger', 'ping', [ 'pong', 'foo' ], $address );
undef;
}
sub pong {
my ($heap, $request, $response) = @_[HEAP, ARG0, ARG1];
print STDOUT Dumper( $request );
print STDOUT Dumper( $response );
undef;
}
__END__
Results:
1.04
$ perl testcase.pl 100.0.0.12
$VAR1 = [
'100.0.0.12',
1,
'1148478604.42889',
'foo'
];
$VAR1 = [
'100.0.0.12',
'0.000467061996459961',
'1148478604.42947'
];
1.11
$ perl testcase.pl 100.0.0.12
$VAR1 = [
'100.0.0.12',
1,
'1148478667.73387'
];
$VAR1 = [
'100.0.0.12',
'0.000382900238037109',
'1148478667.73433'
];
Many thanks in advance,
BinGOs