champkeh/blive-ws

客户端中断/退出时,与B站的ws链接似乎没有被释放掉

Closed this issue · 2 comments

dash deno com_projects_blive_logs_filters=%7B%22query%22%3A%22%22%2C%22timeRangeOption%22%3A%22streaming%22%2C%22recentValue%22%3A%221hour%22%2C%22customValues%22%3A%7B%22start%22%3A%222023-08-26T03%3A48%3A11 253Z%22%2C%22end%22%3A%222023-0

如上图所示,有3个客户端同时链接,进入3个不同的房间,然后在客户端关闭页面时出现上面的日志打印结果。

可以看到,当客户端退出时仍然出现open B站ws服务器的情况

初步推测,可能是因为客户端退出时调用了BliveSocket的销毁函数,然后内部检测到链接关闭就自动进行了重连

已修复,新的打印日志如下,客户端离开时不再出现重连了:

dash deno com_projects_blive_logs_filters=%7B%22query%22%3A%22%22%2C%22timeRangeOption%22%3A%22streaming%22%2C%22recentValue%22%3A%221hour%22%2C%22customValues%22%3A%7B%22start%22%3A%222023-08-26T04%3A08%3A15 116Z%22%2C%22end%22%3A%222023-0