Add JS docs for server stop

This commit is contained in:
advplyr 2023-12-28 16:32:21 -06:00
parent 21d0d43edc
commit 9a634e0de5
2 changed files with 11 additions and 2 deletions

View file

@ -73,10 +73,15 @@ class SocketAuthority {
}
}
/**
* Closes the Socket.IO server and disconnect all clients
*
* @param {Function} callback
*/
close(callback) {
Logger.info('[SocketAuthority] Shutting down')
// This will close all open socket connections, and also close the underlying http server
if (this.io)
if (this.io)
this.io.close(callback)
else
callback()