|
NAMERPC::Simple::Server - Perl class to use in the RPC server script.SYNOPSISuse RPC::Simple::Server; my $server_pid = &spawn ; DESCRIPTIONGeneric 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 functionsmainLoopTo 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, $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.childDeathStatic function called when a child dies. $SIG{CHLD} must be set to \&childDeath by the user.CONSTRUCTORCalled by mainloop. Construct a server. Currently only one server is supported.METHODSacceptSocketcalled 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. readClientRead the client's socket. Execute the code passed through the socket and call the relevant object handlers.returns 0 if the socket is closed. closeClose 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 resetMaskTo be called when the child process is dead.getFilenoReturns the fileno of the client's socket.CAVEATSSome function are provided to handle remote processes. These functions are not yet tested. They may not stay in this class either.AUTHORSCurrent Maintainer Clint Edwards <cedwards@mcclatchyinteractive.com> Original Dominique Dumont, <Dominique_Dumont@grenoble.hp.com> SEE ALSOperl(1).
Visit the GSP FreeBSD Man Page Interface. |