in reply to Net::Server capabilities

If i use Net::Server::(something)Fork personality, the server behaves in a way that it spawns a child process for each connection. That's great, but, the general idea is to have 500 connections to my daemon, and a single connection between the daemon and Asterisk Manager. Behaviour of the Net::Server::Fork personality implies that i'll again have one AstMan connection for each client connection, and that's not the point.

There are several IPC ways to let forked workers communicate with their parent - pipes, message queues, shared memory segments and so on.

Threads are available in perl, too; essentially, anything you have in C. You will have to choose your means, same if you write your server in C, so choice of language isn't relevant here.

You could write a multitasking server in POE and register a session in it for each accept()ed client connection, and have those sessions post events back to the session(s) which talk(s) to AstMan, which you could also spawn dynamically based on responsiveness, latency and load.

Replies are listed 'Best First'.
Re^2: Net::Server capabilities
by rcaputo (Chaplain) on Feb 21, 2009 at 22:49 UTC
    You could write a multitasking server in POE and register a session in it for each accept()ed client connection, and have those sessions post events back to the session(s) which talk(s) to AstMan, which you could also spawn dynamically based on responsiveness, latency and load.

    POE::Component::Client::Asterisk::Manager may help, if you're looking to POE for a potential solution.