使用 socket.io 和 nodejs 强制客户端与服务器断开连接 [英] force client disconnect from server with socket.io and nodejs

查看:38
本文介绍了使用 socket.io 和 nodejs 强制客户端与服务器断开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以断开客户端与 SocketIO 的连接,然后直接关闭连接?因此,如果有人连接到我的服务器,而我想关闭他们与我的服务器之间的连接,我该怎么做?

Is there any way to disconnect a client with SocketIO, and literally close the connection? So if someone is connected to my server, and I want to close the connection between them and my server, how would I go about doing that?

推荐答案

现在可以了

您现在可以简单地调用 socket.disconnect()服务器端.

我原来的回答:

这是不可能的.

如果您也需要它,请对这个问题投票/评论.

If you need it as well, vote/comment on this issue.

这篇关于使用 socket.io 和 nodejs 强制客户端与服务器断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆