in reply to Multithreading on HTTP::Daemon
Does anyone know where in this code I should use fork and how, so that I can make it multithreaded? (code examples, appreciated)#!/usr/bin/perl use HTTP::Daemon; use HTTP::Status; my $d = new HTTP::Daemon LocalPort => 1285; print "Connected as: ", $d->url, "\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET') { $url = $r->url->path; $length = length($url); $substract = $length - 1; $file = substr($url, -$substract); $c->send_file_response($file); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }
Edited 15 Jul 01, 08:45 pm (PDT) by footpad
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Multithreading on HTTP::Daemon
by chromatic (Archbishop) on Feb 17, 2001 at 22:41 UTC | |
|
Re: Re: Multithreading on HTTP::Daemon
by merlyn (Sage) on Feb 17, 2001 at 21:54 UTC |