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::SERVER (3)

.ds Aq ’

NAME

RPC::Simple::Server - Perl class to use in the RPC server script.

CONTENTS

SYNOPSIS



  use RPC::Simple::Server;

 my $server_pid = &spawn ;



DESCRIPTION

Generic server class. The mainLoop function will instantiate one server object for each connection request.

Server also provides functions (childDeath) to monitor children processes.

Exported static functions

    mainLoop

To be called at the end of the main program. This function will perform the select loop, and call relevant server objects.

    goodGuy([ipaddress|host_name])

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.

registerChild($object_ref, CW$pid)

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.

    unregisterChild($pid)

unregister process $pid. Does not call-back the process manager.

    childDeath

Static function called when a child dies. $SIG{CHLD} must be set to \&childDeath by the user.

CONSTRUCTOR

Called by mainloop. Construct a server. Currently only one server is supported.

METHODS

    acceptSocket

called by new. By default, accepts only connection from localhost (127.0.0.1).

    writeSock(index_of_agent, method, reqId, param, [objectName ])

Called by Object handler to send data back to Agent.

param: array_ref of parameters passed to the call-back function.

    readClient

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

Close the connection.

    setMask(object,method, file_number)

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

    resetMask

To be called when the child process is dead.

    getFileno

Returns the fileno of the client’s socket.

CAVEATS

Some function are provided to handle remote processes. These functions are not yet tested. They may not stay in this class either.

AUTHORS



    Current Maintainer
    Clint Edwards <cedwards@mcclatchyinteractive.com>

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



SEE ALSO

perl(1).
Search for    or go to Top of page |  Section 3 |  Main Index


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

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