Closed yaohaizhou closed 1 year ago
Alright, I solved this by adding ping-pong signal in websocket.
Add ping_interval=30,ping_timeout=5,
in relay.py
def connect(self):
self.ws.run_forever(
ping_interval=30,
ping_timeout=5,
sslopt=self.ssl_options,
http_proxy_host=self.proxy_config.host if self.proxy_config is not None else None,
http_proxy_port=self.proxy_config.port if self.proxy_config is not None else None,
proxy_type=self.proxy_config.type if self.proxy_config is not None else None,
)
I want to run a client bot on the server. When a client chats with it, it will return what the client says. The code runs well in the first few minutes, but it cannot receive messages and send messages after that. The process is stuck at
while relay_manager.message_pool.has_events():
(because when I stop the process, the exception location is in this line)The code is below