I have the following script structure: script A opens PIPE on B, and B opens PIPE on C. Thus, the data stream A-> B-> C. B catches SIGPIPE. Although the IN and OUT descriptors are open:
$SIG{'PIPE'} = sub {
$logger->info('caught PIPE signal.');
$logger->info("STDIN status: ".STDIN->opened());
$logger->info("STDOUT status: ".OUT->opened());
die;
};
STDIN status: 1
STDOUT status: 1
I added IN to $ pool IO :: Select and when IN is in $ pool-> can_read (), I read it with sysread (). After a second, I write OUT with the seal. I also have a listening socket in the $ pool, and clients can connect to it. But I only read from customers. I write only on OUT.
source
share