开发者

Multiple TCP Socket Requests on PHP

开发者 https://www.devze.com 2023-02-24 07:39 出处:网络
Is it possible to accept multiple requests (parallel) by using a so开发者_如何学Pythoncket server made on PHP?

Is it possible to accept multiple requests (parallel) by using a so开发者_如何学Pythoncket server made on PHP? If possible, how ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消