On 28/04/06, René Fournier <m5@xxxxxxxxxxxxxxxx> wrote:
Anyone find any good tutorials, code samples, etc. on such a thing? Basically, I want to write server (in PHP) that listeners on a particular port, and spins off a thread/process (essentially, execute a separate script) for each incoming connection. There won't be a lot of data to process, but there will be many simultaneous connections— upwards of 1000s of connections (each spun off as seperate threads).
it's possible in PHP - but you'll unlikely want to do it as seperate processes, even as threads (besides, PHP doesn't have threads?) Check out http://php.net/stream_select and http://netevil.org/node.php?uuid=427d6d12-c107-9816-7428-27d6d128f5e5 With stream_select and the other stream handling software, there are some guys writing a mail server in PHP. I've got a script opening a dozen outbound connections to an external website to push it data myself, and that saves a lot of time rather than waiting for a connection to come back from fopen/fsockopen Alister -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php