It is necessary to close / break a websocket connection to free up a number of resources that were opened as a result of the connection, the only thing that was found in the documentation on aiohttp is the closed field in the class WebSocketResponse .
elif msg.tp == aiohttp.MsgType.close:- m9_psy