Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想disconnect在套接字断开连接时发送一些数据。 有可能这样做还是我必须自己发射disconnect? 我正在使用 socket.io-1.0谢谢。
disconnect
您可以使用简单的 XMLHTTPRequest 和 ajax 将数据发送到 node.js 服务器。服务器必须为此监听一个 url(例如,通过 express)。
另一种通过 websockets 事件发送断开事件的方法。