Skip to content
This repository has been archived by the owner on Mar 21, 2020. It is now read-only.

手动断开连接 #14

Open
DarrenHou1993 opened this issue Mar 2, 2017 · 2 comments
Open

手动断开连接 #14

DarrenHou1993 opened this issue Mar 2, 2017 · 2 comments

Comments

@DarrenHou1993
Copy link

this.engine.close is not a function.
将源码的 if (this.engine) this.engine.close()改成if (this.engine) this.engine.destroy()之后可以断开连接。但是再次 socket.connect()之后 掉线频率太快。

@twototoo
Copy link

twototoo commented Mar 8, 2018

disconnect的reason内容是ping timeout

@twototoo
Copy link

twototoo commented Mar 8, 2018

项目由个pull request,可以解决这个timeout问题
Engine.prototype.destroy = function() {

  • // 销毁的时候关闭socket
  • wx.closeSocket()
  • let sub
    while (sub = this.subs.shift()) { sub.destroy() }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants