Re: Multi-threaded port listener

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



René Fournier 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).

Building it yourself can be lots of fun and I have done this using stream_select, fork, and other PCNTL and IPC functions. If you like Pear, you can check out the Net Server package there. They have models to do the forking for you for each client connection:

http://pear.php.net/package/Net_Server

Although I didn't use Net Server, I did review the code to get ideas on how I'd like to build my server. It is useful.

Dante

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux