无法连接到可操作的插座并且没有错误和拒绝 - 我该怎么办?

发布于 2025-01-19 16:53:05 字数 808 浏览 2 评论 0原文

一些用户无法连接到我的插座,我不知道为什么。我看不到任何错误,但我确实看到它们从未真正连接。这是什么原因是什么,我该怎么办?我正在使用Rails ActionCtacticact。

我看到这是称为的,并且存在房间ID。

window.subscription_channel = consumer.subscriptions.create({channel: "RoomChannel",room: $("[data-room-id]").data("room-id")},
{
  connected: this._connected.bind(this),
  disconnected: this._disconnected.bind(this),
  received: this._received.bind(this),
  rejected: this._rejected.bind(this)
}
);

一旦连接,我设置了一个变量

_connected() {
  window.socket_has_connected_to_room = true
  console.log("connected to room via action cable socket")
}

,我在15秒后进行检查,然后查看window.socket_has_connected_to_room变量不正确,并且可以看到subbcription_channel存在并可以验证window.subscription_channelel.consumer.consumer.connection。断开连接是正确的。在这种情况下我该怎么办?

Some users are unable to connect to my socket and I have no idea why. I don't see any errors but I do see that they never actually connect. What can be the cause of this and what should I do? I am using Rails actioncable.

I see this is called and the room id is present.

window.subscription_channel = consumer.subscriptions.create({channel: "RoomChannel",room: $("[data-room-id]").data("room-id")},
{
  connected: this._connected.bind(this),
  disconnected: this._disconnected.bind(this),
  received: this._received.bind(this),
  rejected: this._rejected.bind(this)
}
);

And once it connects I set a variable

_connected() {
  window.socket_has_connected_to_room = true
  console.log("connected to room via action cable socket")
}

I do a check after 15 seconds and see the window.socket_has_connected_to_room variable is not true and can see the subscription_channel is present and can verify window.subscription_channel.consumer.connection.disconnected is true. What can I do in this scenario?

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

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

发布评论

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