彗星与 PHP:如何在 PHP 聊天系统中使用 Comet?

发布于 2024-07-27 23:40:51 字数 283 浏览 0 评论 0原文

我必须使用 Comet 在 PHP 中构建一个简单的聊天系统。

我不知道这个项目的最佳方法是什么。

最好使用的技术(跨浏览器就更好了)是什么,以及如何实现它? 我可以使用哪些已经支持 Comet 的。 (我不想使用贝叶协议

我已经为聊天系统运行了一个 PHP 后端,但我需要一些关于客户端和服务器之间交互的想法。

谢谢大家。 致以我的问候。

I have to build a simple chat system in PHP using Comet.

I don't know what would be the best approach to this project.

What is the best technique (cross-browser would be nice) to use, and how to implement it? What libraries can I use that already have comet support. (I don't want to use the Bayeux Protocol)

I already have a PHP backend running for the chat system, but I need some ideas for the interaction between client and server.

Thank you all in advance. My regards.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柠北森屋 2024-08-03 23:40:51

您可能需要查看 WebChat2 该项目使用 comet、AJAX 和自定义 HTTP 服务器通过套接字与 IRC 进行通信。

You may want to look at WebChat2 This project uses comet, AJAX, and a custom HTTP server to communicate with IRC via sockets.

我最亲爱的 2024-08-03 23:40:51

图表 & 长篇大论

不幸的是,没有关于PHP 就在那里,尽管您可能会使用其他平台上的 Comet 服务器来包装现有的后端。

关于此有一个 类似的问题,看起来 FastCGI 是你最好的选择。

chart & Long point-by-point discussion

Unfortunately, there's no information for PHP in there, though you could potentially wrap your existing back-end with a comet server on some other platform.

There is a similar SO question about this, looks like FastCGI is your best bet.

花开雨落又逢春i 2024-08-03 23:40:51

php 与 comet 不太匹配,因为无法拥有轻量级请求处理程序。 您必须为每个连接的用户锁定完整的进程。 它可以适用于很少的用户,但不适用于任何中等流量的情况。

php is not a good match for comet, because there is no way to have light weight request handlers. You would have to lock up a full process for each user connected. It could work with very few users, but not for anything with even moderate traffic.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文