我在aws日本 服务器上运行python 的websocket example 代码:
发现监听几秒钟后,自动断开,无论多少次都是如此,请问怎么解决。
自动断开的报错信息:
WARNING:root:WebSocket connection closed: connection was closed uncleanly (“peer dropped the TCP connection without previous WebSocket closing handshake”), code: 1006, clean: False, reason: connection was closed uncleanly (“peer dropped the TCP connection without previous WebSocket closing handshake”)
这个代码文件只是一个列子,如果你想跑更长时间,需要删除下面这几条线:
logging.debug("closing ws connection")
my_client.stop()
1 Like