Multiple connections to an application process

Paul Mahoney (ptm@xact.demon.co.uk)
Tue, 9 Jul 1996 18:11:49 +100 (BST)

Date: Tue, 9 Jul 1996 18:11:49 +100 (BST)
From: Paul Mahoney <ptm@xact.demon.co.uk>
To: fastcgi-developers@openmarket.com
Subject: Multiple connections to an application process
Message-Id: <Pine.SCO.3.90.960709175937.16000G-100000@xact4.xact.com>


Along time ago I know :-)

On Fri, 14 Jun 1996, Mark Brown wrote:
> The current libraries only allow a single connection at a time.  In the
> Apache case, that would be from one of the Apache processes to the FastCGI
> application process (which is really a server, not a client, from the
> FastCGI point of view.)
> 
> If we had a FastCGI library organized in an event-driven style around
> select (which we don't have today), then it would be a very small
> matter to select on the listening socket as well as the current FastCGI
> connection socket and whatever other FDs were active.  When select showed
> the listening socket readable, the event loop would dispatch to a handler
> that would open a new connection.  In this way a single FastCGI application
> process would end up connected to multiple Apache server processes, and
> the FastCGI application would use the select-based event loop to multiplex
> itself between these connections.  The Apache server processes would really
> be none the wiser that they were being served concurrently by a single
> process, since the Apache server processes don't communicate among themselves.

I got some code together that will one day allow me to have connections to 
the multiple Apache server processes...

The first thing it does is an SO_REUSEADDR on FCGI_LISTENSOCK_FILENO...
and it gets errno=99 [EOPNOTSUPP]. On investigation of the Apache fastcgi
module I find that it is using unix domain sockets [AF_UNIX] with file
names of the form /tmp/OM_WS_... 

1. How is reuseability meant to work with AF_UNIX sockets? If it does at all!

2. Must I make a version of the Apache module that uses AF_INET sockets? 

---
Paul Mahoney, X-Act Solutions Limited
smail: Owlsmead, Meads Road, Little Common, Bexhill-on-Sea, East Sussex TN39 4SY
email: ptm@xact.demon.co.uk
phone: +44 424 846368