in reply to HTTP::Daemon cannot support keep alive properly?
In order to handle multiple concurrent requests, you'll have to fork a new process. HTTP::Daemon does not do this for you. From the doc:
This HTTP daemon does not fork(2) for you. Your application, i.e. the +user of the HTTP::Daemon is reponsible for forking if that is desirab +le.
You'll need to add something like this (untested):
my $d = HTTP::Daemon->new || die; while (my $c = $d->accept) { my $childPID; unless (defined $childPID = fork) { # error handling here... next; } if ($childPID == 0) { # we're the child, # your processing code here... } # we're the parent, go back and wait # for another request... }
That should give you an idea of what you'll need to do.
UPDATE - Disregard - I had the wrong end of the stick entirely :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: HTTP::Daemon cannot support keep alive properly?
by pg (Canon) on Oct 11, 2003 at 21:11 UTC |