简体   繁体   English

使用Apache / PHP / Javascript的长期连接(异步服务器推送)?

[英]Long-lived connections (asynchronous server push) with Apache/PHP/Javascript?

I come from more of a Java background. 我来自更多的Java背景。 In the last year or two, it's become somewhat popular to do server push over HTTP using long-lived HTTP connections in Comet . 在过去的一两年里,使用Comet中的长期HTTP连接进行服务器推送是一种流行的方式。 It's an extremely useful technique. 这是一种非常有用的技术。

So I'm curious what the equivalent is with Apache + PHP + Javascript? 所以我很好奇Apache + PHP + Javascript的等价物是什么? One option I see is just using straight AJAX calls (eg with jQuery) but I don't really know how Apache handles them or how I can implement such a thing on the serverside with PHP. 我看到的一个选项就是使用直接的AJAX调用(例如使用jQuery),但我真的不知道Apache如何处理它们或者我如何使用PHP在服务器端实现这样的功能。 Any ideas? 有任何想法吗? Any good resources on this kind of thing? 这种事情有什么好的资源吗?

You can use Comet programming techniques in PHP. 您可以在PHP中使用Comet编程技术。 I think a good place to start is this post , describing how to implement Comet in PHP. 我认为一个好的开始是这篇文章 ,描述了如何在PHP中实现Comet。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM