Multiple TCP socket requests in PHP
1 answer
A regular PHP script cannot receive multiple requests. But if you really plan on creating a socket server (run as a cmdline PHP script) then yes it is possible.
Have a look at http://pear.php.net/package/Net_Server - it's already ready for this. In particular, it uses functions pcntl
to fork multiple processes to deal with individual TCP requests.
Another option would be http://nanoserv.si.kz/ , which has a few more features.
+1
source to share