• This project
    • Loading...
  • Sign in

신지원 / LineMusicChatbot

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Graphs
  • Network
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • LineMusicChatbot
  • node_modules
  • destroyer
  • index.js
  • 엄성진's avatar
    Enhance Security · 581ec038
    581ec038
    엄성진 authored 2021-06-07 17:24:57 +0000
index.js 376 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
module.exports = function (server) {
    var cons = [];
    server.on('connection', function (c) {
        cons.push(c);
        c.on('close', function () {
            var ix = cons.indexOf(c);
            if (ix >= 0) cons.splice(ix, 1);
        });
    });
    
    return function () {
        server.close();
        cons.forEach(function (c) { c.destroy() });
    };
};