in reply to Re: New to perl: IO Select question :(
in thread New to perl: IO Select question :(
I don't think you're right on this one. His code works fine as long as you just replace
my @rhSet = IO::Select->select($readSet, undef, undef, 0); foreach my $rh (@{$rhSet[0]}) {
with (as in your example)
my @rhSet = IO::Select->select($readSet, undef, undef, 0); foreach my $rh (@{$rhSet[0]}) {
The
you added are not needed, and I'd personally consider doing that more harmful than useful.my $connection = $sock->accept(); $readSet->add($connection);
I also don't understand your comment about $sock not being an "active channel". After you create a server socket you can add it to the read set perfectly fine, and the select will return the socket when there's a connection to accept.
In Section
Seekers of Perl Wisdom