I have a TCP client that connects and obtains some type of job to perform
from a central TCP server.
I'm using PoCo::Client::TCP and POE::Wheel::Run for handling the job.
For the Wheel::Run session, I have
sub process_job {
....
my $task = POE::Wheel::Run->new(
Program => sub { run_job($job) },
StdoutFilter => POE::Filter::Reference->new(),
StdoutEvent => "job_results",
StderrEvent => "debug",
CloseEvent => "childterm",
);
....
}
And in the InlineStates hashref for PoCo::Client::TCP
POE::Component::Client::TCP->new(
Alias => "drone",
RemoteAddress => JOB_SERVER,
RemotePort => 3230,
Filter => "POE::Filter::Reference",
Connected => sub {
....
},
ServerInput => sub {
....
$kernel->yield('process_job',$job);
....
},
InlineStates => {
waitload => \&waitload,
process_job => \&process_job,
childterm => \&childterm,
job_results => \&job_results,
dbi_startup => \&dbi_startup,
dbi_error => \&dbi_error,
dbi_success => \&dbi_success,
}
);
I'm not getting any errors when I run this, but for some reason, childterm
is never called. Neither is job_results.
Being new to POE, I'm not exactly sure if this is correct. But similar
examples are shown in the POE Cookbook that (I assume) work.
I've tried adding inline_states and InlineStates to POE::Wheel::Run, but
I get an error when I try.
Any suggestions or thoughts would be very helpful...
Thanks,
Rob
--
Robert Landrum
Systems Programmer