Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的网站需要一个聊天室,我还希望实现一个 facebookesque 个人对个人聊天系统。
对我来说,什么是最具成本效益/性能的(纯粹就 bw 和服务器而言)。常规的 1 秒轮询 ajax 聊天,或彗星解决方案。
谢谢。
Comet通常会导致较低的带宽使用(假设平均每个聊天每秒少于 1 条聊天消息),因为它只会在每条发送的消息中查询一次服务器。不过,它通常会导致与您的服务器的更多并发活动连接。
这篇博客文章可以帮助您更好地对其进行可视化。