RPC::Serialized::Client::STDIO - RPC client using Standard I/O


RPC-Serialized documentation Contained in the RPC-Serialized distribution.

Index


Code Index:

NAME

Top

RPC::Serialized::Client::STDIO - RPC client using Standard I/O

VERSION

Top

version 1.110470

SYNOPSIS

Top

 use RPC::Serialized::Client::STDIO;

 my $c = RPC::Serialized::Client::STDIO->new;

 my $result = $c->remote_sub_name(qw/ some data /);
     # remote_sub_name gets mapped to an invocation on the RPC server
     # it's best to wrap this in an eval{} block

DESCRIPTION

Top

This module allows you to communicate with an RPC::Serialized server over Standard Input and Standard Output.

You would not normally use this module directly, except perhaps for testing. It might be more useful as a base class upon which to build another more useful client.

For further information on how to pass settings into RPC::Serialized, and make RPC calls against the server, please see the RPC::Serialized manual page.

THANKS

Top

This module is a derivative of YAML::RPC, written by pod and Ray Miller, at the University of Oxford Computing Services. Without their brilliant creation this system would not exist.

AUTHOR

Top

Oliver Gorwits <oliver@cpan.org>

COPYRIGHT AND LICENSE

Top


RPC-Serialized documentation Contained in the RPC-Serialized distribution.

package RPC::Serialized::Client::STDIO;
BEGIN {
  $RPC::Serialized::Client::STDIO::VERSION = '1.110470';
}

use strict;
use warnings FATAL => 'all';

use base 'RPC::Serialized::Client';

use IO::Handle;

sub new {
    my $class = shift;

    my $ifh = IO::Handle->new_from_fd( STDIN->fileno, "r" );
    my $ofh = IO::Handle->new_from_fd( STDOUT->fileno, "w" );

    $ofh->autoflush(1);

    return $class->SUPER::new(
        @_, {rpc_serialized => {ifh => $ifh, ofh => $ofh}},
    );
}

1;

# ABSTRACT: RPC client using Standard I/O


__END__