Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Dominique Dumont
October 18, 2004, 6:08 pm
rate this thread
I've uploaded v1.001 of the perl module RPC::Simple (yes, I know, the
last version is 6 years old...)
The main changes are:
- Removed possibility to use AutoLoader in classes communicating over
network. User complained that using AutoLoading made debugging much
- Using Tk control loop is now optional. A custom control loop can be
- changed Factory constructor API to use named parameters. Old API is
still supported (although obsolete)
- better socket cleanup at exit.
Here's the README of RPC::Simple:
This is the README file for RPC::Simple::* , a bunch of Perl classes
to perform simple asynchronous remote procedure calls in an object
This module uses an IO::Select based control loop on the server side.
On the local side, the user can use Tk's control loop or provide it's
own control loop using the socket provided by this module.
To use this set of classes, the user will have to create a set of twin
classes. One will run on the local side, the other on the remote side.
Each twin class will inherit a RPC::Simple::Any[Local|Remote] class.
When done you'll be able to invoke a method from the remote class on the
local object and vice versa. (like $localObj->remotePrint).
When calling the remote method from the local side, you may pass a
code reference which will be stored by the RPC::Simple objects. This
code ref will be called back when the remote function is over. Note
that the remote calls are not blocking, all feedback from the remote
side is performed through asynchronous call-back.
Note that simultaneous remote calls on the same object (or on
different objects) are supported, you'll get the relevant call-back
On the other hand (or side ...), the callback mechanism does not work
when calling a method from the remote side to the local side.
Only a simple method call (albeit with optionnal parameters) is allowed
from the remote side.
Note that the attribute of the twin objects are not automagically
copied or updated on the other side. You will have to explicitely
pass the necessary data from one side to the other if you need it.
See the man pages or the t/tk.t script to get further details. Note
you have install Tk to be able to perform the tests.
About security: When running the server, only a localhost (127.0.0.1)
connection is allowed by default. You may call a server method to allow
connections from other IP (either numeric or name) addresses. Once this is
done, the declared address is considered as a "buddy" and the data
sent to the server are not checked for security (i.e. the Taint mechanism
is defeated). Consider yourself warned.
Note that if security is a real problem for you, you should consider
using penguin (see CPAN) or use SSH tunneling. Note also that I always
opened to comments and suggestion to improve the security aspects.
All in all, I've tried to keep things simple.
So this module should be :
- quite simple to use
It sure is not :
- CORBA (which is blocking)
But it works. (Although I'm opened to suggestion regarging the "un-
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner