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.
有没有办法检测客户端何时与服务器端断开连接?
应用程序.js
ss.event.on(“关闭”,函数(会话){
console.log(客户端断开连接);});
谢谢
检查这两个:
req.on("close", function() { // request closed unexpectedly }); req.on("end", function() { // request ended normally }):