POE::Pipe::OneWay - portable one-way pipe creation (works without POE)
my ($read, $write) = POE::Pipe::OneWay->new(); die "couldn't create a pipe: $!" unless defined $read;
POE::Pipe::OneWay makes unbuffered one-way pipes or it dies trying.
Pipes are troublesome beasts because the different pipe creation methods have spotty support from one system to another. Some systems have pipe(), others have socketfactory(), and still others have neither.
pipe()
socketfactory()
POE::Pipe::OneWay tries different ways to make a pipe in the hope that one of them will succeed on any given platform. It tries them in pipe() -> socketpair() -> IO::Socket::INET order.
So anyway, the syntax is pretty easy:
And now you have a pipe with a read side and a write side.
It's possible to force POE::Pipe::OneWay to use one of its underlying pipe methods. This was implemented for exercising each method in tests, but it's possibly useful for others.
However, forcing OneWay's pipe method isn't documented because it's cheezy and likely to change. Use it at your own risk.
The INET domain socket method may block for up to 1s if it fails.
POE::Pipe::OneWay is copyright 2000 by Rocco Caputo. All rights reserved. POE::Pipe::OneWay is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
To install POE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE
CPAN shell
perl -MCPAN -e shell install POE
For more information on module installation, please visit the detailed CPAN module installation guide.