GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  RPC::SIMPLE::FACTORY (3)

.ds Aq ’

NAME

RPC::Simple::Factory - Perl extension for creating RPC client

CONTENTS

SYNOPSIS



 # with Tk
 use Tk;
 use RPC::Simple::Factory;

 my $mw = MainWindow-> new ;
 my $verbose = 1 ; # up to you

 # create factory
 my $factory = new RPC::Simple::Factory
  (
    tk_top => $mw,
    verbose_ref => \$verbose
  ) ;

 # without Tk
 # create factory
 my $factory = new RPC::Simple::Factory() ;
 my $socket = $factory -> getSocket ;

 # create event loop



DESCRIPTION

This class handles all the tricky stuff involving socket handling. This module was originally written to be used with Tk. Now you can use it without Tk, in blocking mode or asynchronous mode.

Methods

    new(...)

Create the factory. One factory must be created for each remote host.

Parameters are:
tk_top When used with Tk, tk_top is the ref of Tk’s main window. Factory will register the communication socket to Tk’s filevent.
verbose_ref verbose_ref is the ref of a variable. When set to 1 at any time, the object will become verbose i.e. it will print on STDOUT a lot of messages related to the RPC processing.

With Tk, you may use $verboseRef as a text variable on a check button to control whether you want to trace RPC messages or not. If not provided, the object will not be verbose.

remote_host default: localhost
remote_port default: 7810
timeout Socket time out (default 0). See IO::Socket for more details.

    logmsg (...)

print arguments if verbose mode.

newRemoteObject( CW$owner_ref, [ remote_class_name ] ... )

Will create a remote (the remote_class_name) object tied to the owner.

Additional parameters will be passed as is to the remote ’new’ method.

    getRemoteHostName

return the remote host name

    getSocket

Returns the socket created by Factory. So you can use it in your own event loop. When using Factory with Tk, the constructor will take care of registering the socket in Tk’s event loop.

    writeSockBuffer ( agent_index, remote_method, request_id, parameter, [object_name])

Encode the method, object, parameter and send it to the remote object.

agent_index and request_id are used later for the call-back mechanism.

    readSock

read pending data on the socket. Do an eval on the read data to call-back the relevent Agents.

Note that there’s no security implemented (yet).

Static functions

    spawn([port],[verbose])

Will spawn a RPC::Simple server on your machine. Don’t call this function if you need to do RPC on a remote machine.

Return the server pid or null (just like fork)

ON EXIT

When the object is destroyed, the ’END’ routine will be called. This will kill the server if it was created by spawn.

AUTHORS



    Current Maintainer
    Clint Edwards <cedwards@mcclatchyinteractive.com>

    Original
    Dominique Dumont, <Dominique_Dumont@grenoble.hp.com>



SEE ALSO

perl(1), RPC::Simple::Agent(3), RPC::Simple::AnyLocal(3).
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 SIMPLE::FACTORY (3) 2006-05-31

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.