#### This module was created to add client-server interface to a script that runs a lot of times, and needs fast answers, using this interface there are almost no compile time for each access, because the big code is already running, for more information read below. Installation: perl Makefile.PL make make test # There are no tests yet... make install Documentation: ============================================================ Server::FastPL ============================================================ NAME Server::FastPL - Add client-server behavior to scripts. VERSION This document refers to version 1.00 of Server::FastPL, released April 10, 2000 SYNOPSIS --- server --- use Server::FastPL; my $fps = new Server::FastPL(TYPE=>"SERVER",NAME=>"Test"); while ($client = $fps->receive_connect()) { ... } --- client --- use Server::FastPL; my $server = new Server::FastPL(TYPE=>"CLIENT",SERVER=>"/tmp/Test"); ... DESCRIPTION Overview This module is just a convenience wrapper for Server::FastPL::Server and Server::FastPL::Client. You might prefer to use these modules instead of this one. See Server::FastPL::Server and Server::FastPL::Client for instructions. SEE ALSO Server::FastPL::Server; Server::FastPL::Client; COPYRIGHT Copyright (c) 2000, Daniel Ruoso. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms of Perl itself ================================================================= Server::FastPL::Server ================================================================= NAME Server::FastPL::Server - Add client-server behavior to scripts. VERSION This document refers to version 1.00 of Server::FastPL::Server, released April 10, 2000. SYNOPSIS use Server::FastPL::Server my $fps = new Server::FastPL::Server(NAME=>"Test",MAX_CHILDS=>5,DEBUG=>1); while ($client = $fps->receive_connect()) { ... } DESCRIPTION Overview This module adds server behavior to non-server scripts. It works by forking your script into MAX_CHILDS child processes. Unix sockets are used for communicating between the server children and the client script (see Server::FastPL::Client). The model loosely resembles CGI::Fast. Contructor and initialization $fps = new Server::FastPL::Server( # REQUIRED: This is the name of the socket file NAME => "Test", # Socket files dir. "/tmp/" as default. SOCKET_DIR => "/tmp/", # Number of children to fork, 5 as default. MAX_CHILDS => 5, # Debug flag for child processes. 0 as default. DEBUG => 0 ) || die $!; Class and object methods $client = $fps->receive_connect(); This method waits for a connection and returns a FileHandle (a Socket) for input/output to the server. ENVIRONMENT Signals: This module uses two signals: USR1 and CHLD. Do not use these in your script or the server will not work. Child processes: The number of running child processes, established by MAX_CHLD, is maintained by the mother process. DIAGNOSTICS All error messages are passed to $!. Use it in your script to detect errors. BUGS Currently the environment hash (%ENV) is not automatically passed from the client to the server. If you want this functionality you must do this yourself (using this object's socket :) . FILES The module creates the folowing files in directory SOCKET_DIR: NAME The main socket NAME.x A socket for each child NAME.fifo Communication between the mother and children processes. SEE ALSO Server::FastPL::Client IO::Socket AUTHOR Daniel Ruoso (daniel@ruoso.com) COPYRIGHT Copyright (c) 2000, Daniel Ruoso. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms of Perl itself ================================================================ Server::FastPL::Client ================================================================ NAME Server::FastPL::Client - Client interface for the Server::FastPL::Server module. VERSION This document refers to version 1.00 of Server::FastPL::Client, released April 10, 2000. SYNOPSIS use Server::FastPL::Client; $server = new Server::FastPL::Client(SERVER => "/tmp/Test"); ... DESCRIPTION Overview This module provides a socket that serves as the interface between a client script (using this module) and a server script (using Server::FastPL::Server). Constructor and Initialization $server = new Server::FastPL::Client(SERVER=>"/tmp/Test"); There is only one parameter, "SERVER". The value of this parameter is the Server::FastPL::Server server socket filename. In truth, the socket returned is a socket for one of the Server::FastPL::Server child processes. You can then use this socket for communication between your client and server scripts. SEE ALSO Server::FastPL::Server AUTHOR Daniel Ruoso (daniel@ruoso.com) COPYRIGHT Copyright (c) 2000, Daniel Ruoso. All Rights Reserved. This modules is free software. It may be userd, redistributed and/or modified under the same terms of Perl itself. ==================================================================== Thats All Folks.... Daniel Ruoso daniel@ruoso.com