fcgi.py

Robin Dunn robin at alldunn.com
Thu Dec 28 05:03:10 CET 2000


"Victor Muslin" <victor at prodigy.net> wrote in message
news:3a4a90ab.1328483109 at localhost...
> I just found an old posting that says that socket.fromfd() is not
> implemented on Windows platform (though Python documentation does not
> say so). Is there a FastCGI solution for Python for WindowsNT???
>

The fcgi.py module is written such that it expects to be started from a
"FastCGI Environment" such as from mod_fastcgi in Apache or from cgi-fcgi.
On Unix this means that the file descriptor for stdin is a listening socket
pre-created by the parent process that the webserver will connect to in
order to send requests to your fastcgi application.  It's done this way so
mod_fastcgi can create multiple processes all listening on the same socket,
not just the same port, but the same socket.  This is definitly a
unix-thing.

On the other hand if you don't mind losing the multiple process capability,
fcgi.py could probably be tweaked to create its own listening socket instead
of expecting it to already be there.  It could then be started up
independently of the webserver, and on any machine.  With creative use of
threads you can even regain most of the benefit of having multiple processes
running, (start a new thread, or allocate one from a thread pool, for every
connection to the socket.)

--
Robin Dunn
Software Craftsman
robin at AllDunn.com
http://wxPython.org     Java give you jitters?
http://wxPROs.com        Relax with wxPython!






More information about the Python-list mailing list