in reply to HTTP::Daemon Script.
If you cannot fork on your system (i.e. Perl4Win 5.003) you have to use select and/or Multiplex to do the job. But the easiest way might be to fork your processes.use HTTP::Daemon; my $d = HTTP::Daemon->new(LocalPort => 8080); while (my $c = $d->accept) { my $pid= fork; if (! $pid) { ###It's the child process here while (my $r = $c->get_request) { print $r->method ."\n" . $r->url->path ."\n"; } $c->close; undef($c); } ### And that's the end of the while loop from the father process }
----------------------------------- --the good, the bad and the physi-- -----------------------------------
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: HTTP::Daemon Script.
by strredwolf (Chaplain) on Feb 22, 2007 at 17:25 UTC |