warmcat / libwebsockets

canonical libwebsockets.org networking library
https://libwebsockets.org
Other
4.68k stars 1.47k forks source link

websockets connection timeout for client not work #2906

Open hwmagicok opened 1 year ago

hwmagicok commented 1 year ago

Hi, I set timeout_secs and connect_timeout_secs to 3s in lws_context_creation_info for websockets connection, but it seems not work. connection always interrupt at 10s. I use libwebsockets v4.3.0

please tell me, how can i set websockets connection timeout

2023-06-09 17:41:09.030 11799-11867 D: WsCallback in,reason=27,len=0 2023-06-09 17:41:09.030 11799-11867 D: WsCallback in,reason=85,len=0 2023-06-09 17:41:09.031 11799-11867 D: WsCallback in,reason=19,len=0 2023-06-09 17:41:09.031 11799-14773 D: WsCallback in,reason=31,len=0 2023-06-09 17:41:09.031 11799-14773 D: WsCallback in,reason=71,len=0 2023-06-09 17:41:09.031 11799-14773 D: WsCallback in,reason=71,len=0 2023-06-09 17:41:09.031 11799-14773 D: WsCallback in,reason=71,len=0 2023-06-09 17:41:14.025 11799-14773 D: WsCallback in,reason=72,len=0 2023-06-09 17:41:19.032 11799-14773 D: WsCallback in,reason=76,len=0 2023-06-09 17:41:19.032 11799-14773 E: CLIENT_CONNECTION_ERROR: Closed before conn

lailoken commented 3 months ago

What type of connections are you making? ws? wss?

We are having similar issues, we set the timeout to 10min and our connections always seem to die at around 10min. we have stable comms up to that point (with registered pings and pongs every 5 seconds at least)