French, Shawn wrote:
> Although this is working right now, I don't know enough [ anything? :) ]
> about Apache or mod_perl to be sure that this will work in the future.

I can't see how it could be working now, unless it is actually creating 
a new Telnet object on every request.  Your %sessionHash is not shared 
between processes and you have no control over which process will handle 
any request.  You're probably opening new telnet connections from each 
apache process.

> What
> I am really concerned about is that the telnetObj will only be accessible
> from scripts run by the same child process as that which created and saved
> it.

That won't work, since you can't control which process will handle 
requests from the client.

> Is there a better way to do this?

You could write a web server in Perl, which would run a separate 
persistent process for each client on a different port.  Randal wrote a 
column about that: http://www.stonehenge.com/merlyn/WebTechniques/col23.html

You could also use this technique to make a sort of telnet server, and 
hide that server behind Apache/mod_perl, i.e. clients talk to mod_perl 
which talks to the telnet server.

Of course the simplest approach would be to just let each Apache process 
open telnet sessions as needed.

- Perrin




Reply via email to