[英]Queries to server during longpolling
I make longpolling query to, say, http://polling.site.com/polling
. 我向例如
http://polling.site.com/polling
进行longpolling查询。 At the same time I need to make several other queries to server, say http://site.com/polling/?d=cr
. 同时,我需要对服务器进行其他几个查询,例如
http://site.com/polling/?d=cr
。 But they are quenued and are fineshed only when longpolling connection finishes. 但是,只有在长轮询连接完成时才对它们进行排队和处理。 Picture related
图片相关
I use nginx/apache2, php5. 我使用nginx / apache2,php5。
How can I make several queries during longpolling? 在longpolling中如何进行几个查询?
The reason was in the inability to use php session in two connections. 原因是无法在两个连接中使用php会话。 So I used
session_write_close
in longpolling loop and at this time second query completes. 因此,我在longpolling循环中使用了
session_write_close
,此时第二次查询完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.