Skip to content

Commit

Permalink
Ensure WebSocket server is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
coocos committed Apr 4, 2021
1 parent da8d542 commit c6daaaf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/websocket/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ function createWebSocketServer(httpServer: http.Server): ws.Server {
socket.destroy();
}
});
httpServer.on("close", () => {
webSocketServer.close();
});
return webSocketServer;
}

Expand Down

0 comments on commit c6daaaf

Please sign in to comment.