httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: port to the BeBox?
Date Fri, 02 Feb 1996 03:41:56 GMT
  2) sockets are not inherited across fork() calls.  I see this as being a 
  bigger problem.

Yup... it's a problem.  There are three common styles of Unix servers
that I'm aware of:

1) The usual "accept()/fork()" model, in which a parent process holding
   the "listen"ing socket accepts connections (obtaining another socket),
   and then forks off a child to deal with it.  Naturally, this only works
   if the child still has access to the accept()ed socket after the fork.

   (Inetd is a special case of this, which forks and then does an exec()
   of whatever is listed in inetd.conf for the port in question, but not
   different in principle).

2) A "shared accept" server pool, in which several processes have the
   "listen()"ing socket open, and they all accept connections.  This 
   requires that the processes all have access to the same socket ---
   this is generally arranged by opening and binding that socket in
   a common ancestor process which then fork()s to produce the others.

   Apache (and, I think, the Netscape server) use this approach.

3) A "socket passing" server pool, in which a parent process holds the
   listen()ing socket, accepts new connections, and passes them off to
   a stable of child processes to be handled (using whatever system-
   dependant incantations are necessary to transfer an open file
   descriptor between processes).=

   NCSA 1.4 and 1.5 use this approach.

All of these involve transferring permissions on sockets between processes,
either by traditional Unix-style inheritance (as in the first and second
approaches), or more recherche methods.  

Still, there's got to be *some* way to write servers on a BeBox (one hopes!)
--- perhaps they're all threaded, or perhaps there's some incantation which
can cause sockets to be transferred among processes even if it doesn't
necessarily happen automatically.

rst

Mime
View raw message