Strope javascript 防止在某些延迟时断开连接

发布于 2024-08-25 04:53:42 字数 368 浏览 3 评论 0原文

我正在开发 javascript XMPP 应用程序,它使用 Strope 库连接到 Jabber 服务器。当 Strope 连接到服务器时,我需要使线程运行大约 5-10 秒。线程通过运行 java applet 来参与,在释放线程后,它会返回处理 XMPP 事件,但是目前我无法做到这一点 - 尝试在延迟后使用连接会给我 404 HTTP 错误 (这是在 Strope 向其发送带有 XMPP 消息的 POST 请求后,由 XMPP-BOSHS 服务直接发送的)。我试图“暂停”与 Strope 的连接。暂停然后恢复它 - 没有成功。是否会向服务器发送一些原始内容,也许可以告诉它客户端会在短时间内没有响应?还有其他解决方案吗?

谢谢

I am developing javascript XMPP application which uses Strophe library to connect to Jabber server. I need to engage the thread for about 5-10 seconds when Strophe connects to the server. Thread is engaged by running java applet and after it releases the thread it goes back to handle XMPP events, however at the moment I cannot manage to do that - trying to use a connection after delay gives me 404 HTTP error (this is sent by XMPP-BOSHS service straight after Strophe sends POST request with XMPP message to it). I was trying to 'pause' a connection with Strophe's connection.pause and then resume it - didn't work. Would sending some raw content to the server, maybe if it's possible telling it that client's gonna be unresponsive for a short time work ? Are there any other solutions ?

Thanks

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

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

发布评论

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

评论(1

原谅我要高飞 2024-09-01 04:53:42

如果连接已建立,则在会话超时之前您通常有 30-120 秒的时间发送请求。最近对 strope 的更改修复了这里的一个错误,即它不尊重服务器发送的会话超时。

如果您的会话超时,您将收到 404。您是否有最后一个工作节和第一个非工作节的时间戳和节?有了这些,我也许可以告诉你出了什么问题。

If the connection is established, you generally have 30-120 seconds to send a request before the session times out. A recent change to strophe fixed a bug here where it didn't respect the session timeout the server sent.

You'll get a 404 if your session has timed out. Do you have the timestamp and stanza for the last working stanza and the first non-working one? With those I can probably tell you what went wrong.

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