如何避免AJAX刷新?

发布于 2024-09-28 07:02:55 字数 353 浏览 0 评论 0原文

我有一个用 CGI(c++) 编写的客户端和服务器,因为 JS 模型就像向服务器询问一些东西,服务器没有发送异步消息的机制。那么这意味着客户端需要定期轮询服务器?

我读过BOSH协议,它说要实现http的异步,一个网页可以发出多个HTTP请求,但服务器将保持直到客户端有任何异步事件。但我不知道如果没有数据,服务器可以保持连接多长时间。

如何解决这个问题,我想应该已经解决好了:)

Bin

BOSH: http:// xmpp.org/extensions/xep-0206.html

I have a client and a server written in CGI(c++), as JS model is like to ask something from server, there is no mechanism for server to send async message. So this means the client needs to poll server periodically?

I read BOSH protocol, it says to achieve the async for http, a web page can issue several HTTP request, but the server will hold until it has any async events to the client. But I don't know how long the server can hold the connection if there is no data.

How to resolve this problem, i think it should be resolved well already :)

Bin

BOSH: http://xmpp.org/extensions/xep-0206.html

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文