On Friday 03 January 2003 06:15 am, Gareth Hastings wrote:
> Yes I saw those but what it made me think, what's the point of a
> persistent socket if you can't use it again? 

i think you could, after enough iterations and if the server allows, 
get to a point where each process has its own persistent socket.
in the script, first detect if the persistent socket already exists.
if it does, use it.  if it doesn't, open a new persistent socket.  that
process now has a persistent socket that you can use.

if there is enough traffic, eventually each process will have its
own persistent socket.

of course, this only works well if the server (the process monitoring
the socket on the box you're opening a persistent socket to) 
allows it and is written to allow multiple "simultaneous" access to
the service without getting corruption (it may be necessary for the
server side process to have explicit communication or locking 
between the multiple processes spawned (or locking within the
same process, if it uses select()).

NOTE: i have not tested any of the above, it's just an obvious
extension to the comment about persistent sockets being bound 
to the particular web server process.

tiger

-- 
Gerald Timothy Quimpo  tiger*quimpo*org gquimpo*sni-inc.com tiger*sni*ph
Public Key: "gpg --keyserver pgp.mit.edu --recv-keys 672F4C78"
                   Veritas liberabit vos.
                   Doveryai no proveryai.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to