Server::Control::NetServer -- apachectl style control for Net::Server servers
version 0.20
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(...); }
Server::Control::NetServer is a subclass of Server::Control for Net::Server servers.
Server::Control::NetServer
The constructor options are as described in Server::Control, except for:
Required. Specifies a Net::Server subclass. Will be loaded if not already.
Net::Server
Specifies a hashref of parameters to pass to the server's run() method.
run()
Will be taken from "net_server_params".
If not provided, will attempt to get from log_file key in "net_server_params".
log_file
Server::Control, Net::Server
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Server::Control, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Server::Control
CPAN shell
perl -MCPAN -e shell install Server::Control
For more information on module installation, please visit the detailed CPAN module installation guide.