RPC-Serialized
view release on metacpan or search on metacpan
lib/RPC/Serialized.pm view on Meta::CPAN
my @token = ();
eval {
if ($self->debug) {
$data = $self->ds->raw_deserialize($data);
}
else {
my $token = $self->ds->_get_token($data);
@token = $self->ds->_extract_token($token) if defined $token;
$data = $self->ds->deserialize($data);
}
};
throw_proto "Data::Serializer error: $@"
if $@;
throw_proto 'Serializer parse error'
if !defined $data or $data == 1;
throw_proto 'Data not a hash reference'
if ref($data) ne 'HASH';
return (wantarray
? ($data, @token)
: $data);
}
sub DESTROY {
my $self = shift;
$self->ifh->close if $self->ifh;
$self->ofh->close if $self->ofh;
}
1;
# ABSTRACT: Subroutine calls over the network using common serialization
# Here are some of the less common error messages. When more time is available
# these will be futher documented:
#
# =over 4
#
# =item C<Permission denied> in an C<X::Authorization>
#
# The authorization scheme loaded has refused to permit the current subject to
# make the current call.
#
# =item C<TCPREMOTEINFO not set> in an C<X::Authorization>
#
# The C<UCSPI/TCP> server will look for the C<TCPREMOTEINFO> environment
# variable, if authorization is enabled. See the C<ucspi-tcp> documentation for
# details if you don't know how to enable this.
#
# =item C<IPCREMOTEEUID not set> in an C<X::Authorization>
#
# The C<UCSPI/IPC> server will look for the C<IPCREMOTEINFO> environment
# variable, if authorization is enabled. See the <ucspi-ipc> documentation for
# details if you don't know how to enable this.
#
# =item C<getpwuid $uid failed> in an C<X::Authorization>
#
# The C<UCSPI/IPC> server failed to get the username for the calling user. Only
# happens if authorization has been enabled.
#
# =item C<Not a RPC::Serialized::AuthzHandler> in an C<X::Application>
#
# Server authorization is enabled but the specified handler does not inherit
# from L<RPC::Serialized::AuthzHandler>.
#
# =item C<Failed to open GDBM file...> in an C<X::System>
#
# =item C<Missing or invalid URI> in an C<X::Application>
#
# =item C<Can't determine path from URI ...> in an C<X::Application>
#
# =item C<Failed to open ...> in an C<X::System>
#
# =item C<Target name not specified> in an C<X::Application>
#
# =item C<Failed to parse scheme from URI ...> in an C<X::Application>
#
# =item C<Unsupported URI scheme ...> in an C<X::Application>
#
# =item C<Failed to load ...> in an C<X::System>
#
# =item C<Subject name not specified> in an C<X::Application>
#
# =item C<Operation name not specified> in an C<X::Application>
#
# =item C<Open $acl_path failed: ...> in an C<X::System>
#
# =item C<Failed to parse ACLs at ...> in an C<X::Application>
#
# =item C<ACL path not specified> in an C<X::Application>
#
# =back
__END__
=pod
=head1 NAME
RPC::Serialized - Subroutine calls over the network using common serialization
=head1 VERSION
version 1.123630
=head1 SYNOPSIS
# for the RPC server...
# choose one of the supplied server types (NetServer is Net::Server)
use RPC::Serialized::Server::NetServer;
my $s = RPC::Serialized::Server::NetServer->new;
$s->run;
# server process is now looping and waiting for RPC (like Apache prefork)
# the default port number for Net::Server is 20203
( run in 2.195 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )