in reply to Re^3: POE method problem (building applications with POE)
in thread POE method problem (building applications with POE)

Hi Mike, thanks for your reply.

The nice editors from perl.com fixed the download link after I mailed them.
The downloaded code clears up alot of things.
The wheel-id from POE::Wheel::SocketFactory is indeed the same throughout the whole program run.
Only the wheel-id in POE::Wheel:ReadWrite is different for each connection. This is the only wheel-id that needs to be stored (and destroyed).

I changed subroutines 'factory_success' and 'client_input' accordingly and it works now!

The code in the perl.com article and the code made available through the download link are different from each other which is a confusing for a POE newbie like me ;-)

sub factory_success { my $handle = $_[ARG0]; my $wheel_id = POE::Wheel::ReadWrite->new( Handle => $handle, Driver => POE::Dri +ver::SysRW->new(), Filter => POE::Fil +ter::SimpleQueryString->new(), InputEvent => 'client_ +input', ); $_[HEAP]->{clients}->{$wheel_id->ID} = $wheel_id; } sub client_input { my ($input, $wheel_id) = @_[ARG0, ARG1]; use Data::Dumper; print Dumper $input; $_[HEAP]->{clients}->{$wheel_id}->put($input); }