in reply to Re: Multithreading on HTTP::Daemon
in thread Multithreading on HTTP::Daemon
In your case, I wouldn't rely on random port numbers from HTTP::Daemon. I'd keep a hash around of about five port numbers, and have a kid in each. Fork them off from the parent, then let the parent wait for them to finish and to die off, then fork off a new kid on the same port. If you set the Reuse flag in the HTTP::Daemon constructor, you should be okay.
If you want to get more sophisticated, you can keep a cache of most-recently used children. But once you start getting into those things, you're just playing. For production stuff, I'd go with an actual web server. It's non-trivial to get these things correct.
|
|---|