Skip to content

Commit

Permalink
fix: Server never emits close event if no connections (#156)
Browse files Browse the repository at this point in the history
Fixes #144
  • Loading branch information
hans00 committed Aug 22, 2022
1 parent 3cf5a1a commit 6eec851
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,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;
}

Expand Down

0 comments on commit 6eec851

Please sign in to comment.