Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
srv
/
data
/
trash
/
vhost_www.bachtale.com_1719306535
/
htdocs
/
node_modules
/
killable
/
//srv/data/trash/vhost_www.bachtale.com_1719306535/htdocs/node_modules/killable/index.js
module.exports = function makeKillable(server) { var sockets = []; server.on('connection', function (socket) { //add socket to list sockets.push(socket); socket.once('close', function () { //remove socket from list sockets.splice(sockets.indexOf(socket), 1); }); }); server.kill = function (cb) { server.close(cb); sockets.forEach(function (socket) { socket.destroy(); }); // reset so the server can be restarted sockets = []; }; return server; };