Javascriptexport default class WebSocketEx{
connect = function () { // 断开之前的连接
if (this.con) { this.con.close()
} this.con = new WebSocket('ws://******:***')
}
}调用WebSocketEx.connect()
WebSocketEx.connect()
WebSocketEx.connect()
WebSocketEx.connect()
...图片疑问请问为什么 close() 了连接依旧存活着呢?是我写法有问题吗?
添加回答
举报
0/150
提交
取消