我正在使用 node-binance-api。
我在创建 Vue.js 页面时打开了 websocket。
created(){
client2.ws.futuresTicker(this.ticker, ticker => {
that.currentPrice = ticker.curDayClose
})
}
这将打开 websocket。但过了一段时间,我有 20 到 30 次价格更新,好像 websocket 没有关闭。
有时,如果我刷新页面,它会起作用。但有时刷新页面并不能解决问题。
有没有办法专门关闭套接字?
我试过了
client2.ws.close()
但那不可用。