[mod_python] webinterface for a local telnet server

Jorey Bump list at joreybump.com
Fri Oct 6 12:14:43 EDT 2006

Andreas Klauer wrote:
> On Fri, Oct 06, 2006 at 03:32:35PM +0200, Mike Looijmans wrote:
>> I think that is the only way it will ever work reliably. You can get 
>> Apache to run in a single process, so that you can simply use a 
>> dictionary (user->connection) and a bit of mutexing to manage your 
>> connections.
> It's not that I don't like threads, but it is contra-productive to not 
> have any control over them. It'd be great if my mod_python script could 
> just say 'Hey, this guy belongs to another thread' and it would switch 
> over there or something.
> I suppose I can't do inter process communication between mod_python 
> threads either (or it would not be feasible to do so...), i.e. having 
> every mod_python thread double acting as a daemon for the others?

I think the problem is outside of apache/mod_python. Similar work has 
been done to develop IMAP proxies to reduce load caused by webmail 
opening a new connection to the IMAP server for every click. You might 
want to start there for examples.

Since HTTP is stateless, you'll need a proxy to hold the telnet 
connections open, track user connections, and timeout idle connections 
after a specified period of time. I'm probably stating the obvious, but 
the solution is easier to describe than implement. The devil is in the 
details. You might look at twisted for examples of proxy code.

More information about the Mod_python mailing list