websockets
websockets copied to clipboard
Close method is not working
Hi !!!, i just started to use your module, everything is okey but when i try to close the server connection nothing happens, no error menssajes or output logs..., is this a bug ?? Here's an example of my code:
import asyncio
import websockets
async def echo(websocket):
async for message in websocket:
print(message)
# if the message is equals to 'some' (it's just and example : D) we close the server
if message == "some":
await websocket.close()
async def main():
async with websockets.serve(echo, "localhost", 8000):
await asyncio.Future() # run forever
asyncio.run(main())
Can you enable debug logs? https://websockets.readthedocs.io/en/stable/topics/logging.html?highlight=debug%20logs#configure-logging
Then you should get logs.
I don't have enough information to take action on this issue. Given the lack of updates in two months, I will close it.