From a65de37cef21cbf744eb40fb63f795921e8ac7f8 Mon Sep 17 00:00:00 2001 From: John Belmonte Date: Mon, 1 Feb 2021 22:41:27 +0900 Subject: [PATCH] server: close TCP connection after closing websocket Fixes #115 and #147. --- trio_websocket/_impl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/trio_websocket/_impl.py b/trio_websocket/_impl.py index 36d6cbf..6c5d4d1 100644 --- a/trio_websocket/_impl.py +++ b/trio_websocket/_impl.py @@ -1018,6 +1018,7 @@ async def _close_web_socket(self, code, reason=None): exc = ConnectionClosed(self._close_reason) logger.debug('%s websocket closed %r', self, exc) await self._send_channel.aclose() + await self._close_stream() async def _get_request(self): '''