.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Net::Server::Fork 3pm" .TH Net::Server::Fork 3pm "2018-02-12" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::Server::Fork \- Net::Server personality .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use base qw(Net::Server::Fork); \& \& sub process_request { \& #...code... \& } \& \& _\|_PACKAGE_\|_\->run(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Please read the pod on Net::Server first. This module is a personality, or extension, or sub class, of the Net::Server module. .PP This personality binds to one or more ports and then waits for a client connection. When a connection is received, the server forks a child. The child handles the request and then closes. .PP With the exception of parent/child signaling, this module will work (with basic functionality) on Win32 systems. .SH "ARGUMENTS" .IX Header "ARGUMENTS" .IP "check_for_dead" 4 .IX Item "check_for_dead" Number of seconds to wait before looking for dead children. This only takes place if the maximum number of child processes (max_servers) has been reached. Default is 60 seconds. .IP "max_servers" 4 .IX Item "max_servers" The maximum number of children to fork. The server will not accept connections until there are free children. Default is 256 children. .IP "max_dequeue" 4 .IX Item "max_dequeue" The maximum number of dequeue processes to start. If a value of zero or undef is given, no dequeue processes will be started. The number of running dequeue processes will be checked by the check_for_dead variable. .IP "check_for_dequeue" 4 .IX Item "check_for_dequeue" Seconds to wait before forking off a dequeue process. It is intended to use the dequeue process to take care of items such as mail queues. If a value of undef is given, no dequeue processes will be started. .SH "CONFIGURATION FILE" .IX Header "CONFIGURATION FILE" See Net::Server. .SH "PROCESS FLOW" .IX Header "PROCESS FLOW" Process flow follows Net::Server until the post_accept phase. At this point a child is forked. The parent is immediately able to wait for another request. The child handles the request and then exits. .SH "HOOKS" .IX Header "HOOKS" The Fork server has the following hooks in addition to the hooks provided by the Net::Server base class. See Net::Server .ie n .IP """$self\->pre_accept_hook()""" 4 .el .IP "\f(CW$self\->pre_accept_hook()\fR" 4 .IX Item "$self->pre_accept_hook()" This hook occurs just before the accept is called. .ie n .IP """$self\->post_accept_hook()""" 4 .el .IP "\f(CW$self\->post_accept_hook()\fR" 4 .IX Item "$self->post_accept_hook()" This hook occurs in the child after the accept and fork. .ie n .IP """$self\->run_dequeue()""" 4 .el .IP "\f(CW$self\->run_dequeue()\fR" 4 .IX Item "$self->run_dequeue()" This hook only gets called in conjunction with the check_for_dequeue setting. .SH "HOT DEPLOY" .IX Header "HOT DEPLOY" Since version 2.000, the Fork server has accepted the \s-1TTIN\s0 and \s-1TTOU\s0 signals. When a \s-1TTIN\s0 is received, the max_servers is increased by 1. If a \s-1TTOU\s0 signal is received the max_servers is decreased by 1. This allows for adjusting the number of handling processes without having to restart the server. .SH "AUTHOR" .IX Header "AUTHOR" Paul Seamons .PP Rob Brown .SH "SEE ALSO" .IX Header "SEE ALSO" Please see also Net::Server::INET, Net::Server::PreFork, Net::Server::MultiType, Net::Server::SIG Net::Server::Single