【问题标题】:socket.io event on reconnect timeout重新连接超时时的 socket.io 事件
【发布时间】:2013-07-07 02:18:17
【问题描述】:

我正在使用 socket.io 在我的应用程序中进行 websocket 通信。 连接丢失后,它尝试重新连接 6 次,然后达到超时。 是否有任何事件在不再尝试重新连接时发出?

【问题讨论】:

  • 你能出示你的代码吗?

标签: javascript websocket socket.io reconnect


【解决方案1】:

我发现这是一个已知问题。

参考:https://github.com/LearnBoost/socket.io/issues/652

伤心... :(

【讨论】:

    【解决方案2】:

    从源代码看来,事件是“reconnect_failed”

    if (this.attempts > this._reconnectionAttempts) {
    this.emit('reconnect_failed');
    this.reconnecting = false;
    } 
    

    【讨论】:

    猜你喜欢
    • 2013-12-31
    • 2013-12-27
    • 2011-11-22
    • 2016-03-28
    • 1970-01-01
    • 2015-04-03
    • 2014-11-19
    • 2014-03-18
    • 2012-07-24
    相关资源
    最近更新 更多