Expect close in WsServer connection disconnect

Don't bother doing the prepareDisconnect dance if the connection is
already broken. This avoids having to wait until the connection times
out when a slave gives up on a current connection and starts a new one.
This commit is contained in:
Hornwitser committed 2021-09-28 21:28:38 +02:00
1 parent 4a72c14b74
commit bfec83996a
1 file changed
+1
+1
View File
@@ -64,6 +64,7 @@ class BaseConnection extends libLink.Link {
}
async disconnect(code, reason) {
this.connector.setClosing();
try {
await libLink.messages.prepareDisconnect.send(this);
} catch (err) {