RPC::Simple::Server - Perl class to use in the RPC server script.
use RPC::Simple::Server; my $server_pid = &spawn ;
Generic server class. The mainLoop function will instantiate one server object for each connection request.
Server also provides functions (childDeath) to monitor children processes.
To be called at the end of the main program. This function will perform the select loop, and call relevant server objects.
Declare the IP address or the host name as a buddy. Connection from buddies will be accepted. localhost is always considered as a good guy.
Register process $pid as a process to be monitored by server. $object_ref is the process manager of this child. $object_ref::process_over will be called back when (or shortly after) the child dies.
unregister process $pid. Does not call-back the process manager.
Static function called when a child dies. $SIG{CHLD} must be set to \&childDeath by the user.
Called by mainloop. Construct a server. Currently only one server is supported.
called by new. By default, accepts only connection from localhost (127.0.0.1).
Called by Object handler to send data back to Agent.
param: array_ref of parameters passed to the call-back function.
Read the client's socket. Execute the code passed through the socket and call the relevant object handlers.
returns 0 if the socket is closed.
Close the connection.
Function used by any object controlling a child process. Register the object and the method to call back when reading from the passed file descriptor.
file_number is as given by fileno
To be called when the child process is dead.
Returns the fileno of the client's socket.
Some function are provided to handle remote processes. These functions are not yet tested. They may not stay in this class either.
Current Maintainer Clint Edwards <cedwards@mcclatchyinteractive.com> Original Dominique Dumont, <Dominique_Dumont@grenoble.hp.com>
perl(1).
To install RPC::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RPC::Simple
CPAN shell
perl -MCPAN -e shell install RPC::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.