2

Is it possible to accept multiple requests (parallel) by using a socket server made on PHP? If possible, how ?

1
  • perhaps a little on what you hoped to achieve by doing this, my solicit a better quality answer Commented Apr 14, 2011 at 6:46

1 Answer 1

1

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 pcntl functions 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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.