Subject: | Unable to process requests using Net::Server::INET::Handle |
I'm unable to use Net::Server::INET to add inetd-functionality to an
existing application because the IO Handle cannot be read from. Minimal
code to illustrate the issue follows.
Expected output: The program should copy stdin into stdout.
Actual output: Warning "readline() on unopened filehandle HAND at
MyServer.pl line 12." and the execution ends.
-----------------------------------
use warnings;
use strict;
package MyServer;
use parent 'Net::Server::INET';
sub process_request {
my ($self) = @_;
my $sock = $self->{server}{client};
while (<$sock>) {
print $sock $_;
}
}
package main;
my $server = MyServer->new();
$server->run();
------------------------------
(perl 5.14.2, Linux 3.5.0 x86_64)