Re: Undocumented Socket functions?

From: Date: Thu, 15 Feb 2001 09:14:53 +0000
Subject: Re: Undocumented Socket functions?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-39859@lists.php.net to get a copy of this message
Rick Hodger wrote:
I'm not honestly sure if it'd be possible. Normally you would have a daemon running that listens for incoming connections and then spawns another process for each connection. Then the daemon goes back to listening. As far as I know, PHP doesn't have any sort of fork() or process spawning type commands.
It should be entirely possible to manage multiple connections to a socket using the alternative to forking, select(). I don't know enough about select() and its corresponding functions, but they are there and they should allow the ability to step through and deal with each connection without ever forking a new process. Those functions are part of the Socket extension to PHP, but they are undocumented. I would be very happy to see an example of their usage in PHP (as the C examples are leaving me quite baffled). --
                    Visit the Gates Motel webgame:
                    http://www.gameslate.com/gatesmotel/


« previous php.general (#39859) next »