NAME

Server::Control::NetServer -- apachectl style control for Net::Server servers

SYNOPSIS

package My::Server;
use base qw(Net::Server);
sub process_request {
   #...code...
}

---

use Server::Control::NetServer;

my $ctl = Server::Control::NetServer->new(
    net_server_class  => 'My::Server',
    net_server_params => {
        pid_file => '/path/to/server.pid',
        port     => 5678,
        log_file => '/path/to/file.log'
    }
);
if ( !$ctl->is_running() ) {
    $ctl->start(...);
}

DESCRIPTION

Server::Control::NetServer is a subclass of Server::Control for Net::Server servers.

CONSTRUCTOR

The constructor options are as described in Server::Control, except for:

net_server_class

Required. Specifies a Net::Server subclass. Will be loaded if not already.

net_server_params

Specifies a hashref of parameters to pass to the server's run() method.

pid_file

Will be taken from "net_server_params".

port

Will be taken from "net_server_params".

error_log

If not provided, will attempt to get from log_file key in "net_server_params".

AUTHOR

Jonathan Swartz

SEE ALSO

Server::Control, Net::Server

COPYRIGHT & LICENSE

Copyright (C) 2007 Jonathan Swartz.

Server::Control::Apache is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantibility and fitness for a particular purpose.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.