The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

POE::Component::GCS::Server - Generic network server model

VERSION

This document describes version 0.01, released November, 2005.

SYNOPSIS

#!/opt/perl/bin/perl -T
# 
# File:  gcsServer.pl
#
use PTools::Local;
use POE::Component::GCS::Server;

$configFile = PTools::Local->param('app_cfgdir', "gcs/gcs.conf");

exit( run POE::Component::GCS::Server( $configFile ) );

DESCRIPTION

This class is used to start a generic network server daemon. To cleanly shutdown the server, send a SIGTERM to the process ID, which can be accomplished by running the server startup script, shown in the Synopsis section, above, with a command-line option of '-shutdown'. Use the '-h' (or '--help') option to see available options and arguments.

A configuration file is optional. Without this, default port number(s) is/are specified for the TCP server(s). See POE::Component::GCS::Server::TCP for configuration details.

This set of Generic Client/Server (GCS) classes implement a working example of a "Server | Controller | Subprocess" pattern, which consists of 1) a network server, 2) a process manager and 3) a set of child processes that asynchronously perform long-running tasks.

Constructor

run ( [ ConfigFile ] )

This is the only public method used to start the generic server. The optional ConfigFile parameter can be added to specify an external file used to configure a the server. When used, this is expected to be either a full or relative path to the file.

Methods

None. The only public methods are those described above.

DEPENDENCIES

This class depends upon the following:

POE (the Perl Object Environment),
POE-Event-Message and
PTools

SEE ALSO

For discussion and examples of using an external configuration file see POE::Component::GCS::Server::Cfg. For discussion of client access, see POE::Component::GCS::Client.

AUTHOR

Chris Cobb, <no spam [at] ccobb [dot] net>

COPYRIGHT

Copyright (c) 2005-2007 by Chris Cobb. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.