From da8f2ad36c386497b16075790a364faae50fcd47 Mon Sep 17 00:00:00 2001 From: Niall Shaw <100220424+niall-shaw@users.noreply.github.com> Date: Fri, 24 Feb 2023 13:01:47 +0200 Subject: [PATCH] fix: create new socket if socket state is 'closing' (#1337) Signed-off-by: Niall Shaw --- packages/core/src/transport/WsOutboundTransport.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/transport/WsOutboundTransport.ts b/packages/core/src/transport/WsOutboundTransport.ts index 1c248036da..68c882fa2b 100644 --- a/packages/core/src/transport/WsOutboundTransport.ts +++ b/packages/core/src/transport/WsOutboundTransport.ts @@ -75,7 +75,7 @@ export class WsOutboundTransport implements OutboundTransport { // If we already have a socket connection use it let socket = this.transportTable.get(socketId) - if (!socket) { + if (!socket || socket.readyState === this.WebSocketClass.CLOSING) { if (!endpoint) { throw new AriesFrameworkError(`Missing endpoint. I don't know how and where to send the message.`) }