From 8927db93f6ca96abaacfea39f8ca50ce9d41bcdb Mon Sep 17 00:00:00 2001 From: Tanguy Date: Thu, 19 May 2022 14:27:44 +0200 Subject: [PATCH] Read frames instead of messages on close Since #109, there can be only one concurrent user of recvMsg. So in case someone is already reading, better to readFrames --- websock/session.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/websock/session.nim b/websock/session.nim index 5456f37..6774193 100644 --- a/websock/session.nim +++ b/websock/session.nim @@ -455,6 +455,6 @@ proc close*( # read frames until closed while ws.readyState != ReadyState.Closed: - discard await ws.recvMsg() + discard await ws.readFrame() except CatchableError as exc: trace "Exception closing", exc = exc.msg