Home  >  Article  >  Backend Development  >  求php拥塞函数

求php拥塞函数

WBOY
WBOYOriginal
2016-06-13 12:48:15834browse

求php阻塞函数
有这样一个需求,a.php执行完成后不能结束,需要阻塞在那里。然后b.php和外部通信并且将外部来的数据传到阻塞中的a.php。
然后最好不要用socket的在网络上的阻塞。


------解决方案--------------------
版主说的对啊,a既然阻塞了,又如何执行接收的动作呢?
a只能做监听的动作,而不是阻塞
------解决方案--------------------
在 http 会话中,php 是作为 http 服务器的工作程序出现的。
如果 php 被挂起,那么 http 服务器因没有得到返回,而不会终止本轮会话
由于 http 协议是无状态协议,所以会话不能重入。(想插话,但不知道在哪里插)

我猜测你打算做服务器推。
由于这种应用与浏览器密切相关,所以目前 php 尚未支持(当然有些服务器端语言已开始支持了)
可以见到的此类 php 应用,是需要用 socket 做服务器的。而你又不愿意那样做
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn