Is it possible to accept multiple requests (parallel) by using a socket server made on PHP?
If possible, how ?
Is it possible to accept multiple requests (parallel) by using a socket server made
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A normal PHP script cannot receive multiple requests. But if you really plan on creating a socket server (started as cmdline php script), then yes it’s possible.
Look into http://pear.php.net/package/Net_Server – it provides already some preparations for that. Specifically it uses the
pcntlfunctions to fork into multiple processes to work on separate TCP requests.Another option would be http://nanoserv.si.kz/ which has a few more features.