node.js http服务器,检测客户端何时断开

我使用express和node.js作为http服务器。 我存储响应对象,这样我就可以将事件传送到该通道上的客户端。 有没有办法检测客户端何时断开连接? 当我杀死我的客户端,我仍然可以写入响应对象,而不会得到任何forms的exception/错误。 它看起来像服务保持底层TCP通道打开,只要我不断写入响应对象。

req.on("close", function() { // request closed unexpectedly }); req.on("end", function() { // request ended normally }):