def _accept(self, websocket, path): print("Connection opened.") try: while True: await self._process(websocket, path) except websockets.ConnectionClosed: print("Closing connection.")