|Perl Monk, Perl Meditation|
Event based handling of multiple connections with AnyEventby bennymack (Pilgrim)
|on Oct 28, 2008 at 20:01 UTC||Need Help??|
bennymack has asked for the
wisdom of the Perl Monks concerning the following question:
It's been a while but I've got a problem that I can't easily find the solution to for some reason. It involves event-based programming which I am just starting to wrap my head around.
I'm basically trying to write a simple test server that can allow multiple connections per process. It seems like this should be right up the alley of any of the asynchronous IO modules on CPAN. As in, it seems like I should be able to write a single process server that handles multiple long-lived requests by multiplexing the socket reads and writes.
Unfortunately I cannot get this to work. I really just need a recipe and then I can take it from there. I have an example that will respond to two persistent connections but anymore than that and the requests just are basically ignored until a process is cleared up. I probably should start with a single process example and go from there. Maybe I'm just confusing matters. It seems like it should be pretty simple.
Here's what I have so far. Please to be helping me out :)