From bfec83996aae727267eee6c1eed27f0ca67bacd6 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Tue, 28 Sep 2021 21:28:38 +0200 Subject: [PATCH] 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. --- packages/master/src/BaseConnection.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/master/src/BaseConnection.js b/packages/master/src/BaseConnection.js index 44c086e6..e7bca6fa 100644 --- a/packages/master/src/BaseConnection.js +++ b/packages/master/src/BaseConnection.js @@ -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) {