X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FConnector%2FSTDIO.pm;h=69ba95d4401d6f508ba299453f82271fef53c6f5;hp=4ea49afbf0772c842a18990938ac3476322c32fc;hb=12fb4a80d68ad14c18a35f60cc6d8a671f728ac9;hpb=9e72f0cf54e92bccdba71eb75037f1cfe4f69f36 diff --git a/lib/Object/Remote/Connector/STDIO.pm b/lib/Object/Remote/Connector/STDIO.pm index 4ea49af..69ba95d 100644 --- a/lib/Object/Remote/Connector/STDIO.pm +++ b/lib/Object/Remote/Connector/STDIO.pm @@ -1,7 +1,9 @@ package Object::Remote::Connector::STDIO; use File::Spec; +use IO::Handle; use Object::Remote::Connection; +use Object::Remote::ReadChannel; use Moo; sub connect { @@ -12,12 +14,12 @@ sub connect { # only potentially bloody confusing but results in warnings like: # "Filehandle STDOUT reopened as STDIN only for input" close STDIN or die "Closing stdin: $!"; - open STDIN, '<', File::Spec->dev_null or die "Re-opening stdin: $!"; + open STDIN, '<', File::Spec->devnull or die "Re-opening stdin: $!"; close STDOUT or die "Closing stdout: $!"; - open STDOUT, '>', File::Spec->dev_null or die "Re-opening stdout: $!"; - Object::Remote::Connection->new( + open STDOUT, '>', File::Spec->devnull or die "Re-opening stdout: $!"; + return Object::Remote::Connection->new( send_to_fh => $stdout, - receive_from_fh => $stdin + read_channel => Object::Remote::ReadChannel->new(fh => $stdin) ); }