diff --git a/src/Server.js b/src/Server.js index 0a5bf3b..2de7201 100644 --- a/src/Server.js +++ b/src/Server.js @@ -95,6 +95,7 @@ export default class Server extends EventEmitter { if (callback) this.once('close', callback); this.listening = false; Sockets.close(this._id); + if (this._connections.size === 0) this.emit('close'); return this; }