B billzhan Active Member Licensed User Longtime User Aug 13, 2014 #1 Hi all, I've found that when a b4j websocket thread is not active for about 2 hours (in debug mode), the ws connection will be closed by server. Logs (in red): Code: Copy Timeout on Read Connection has been closed locally I can refresh the page every 1 hour or so, but it will cause other problems. How can I set the expiration time? Thanks in advance. bz Last edited: Aug 13, 2014
Hi all, I've found that when a b4j websocket thread is not active for about 2 hours (in debug mode), the ws connection will be closed by server. Logs (in red): Code: Copy Timeout on Read Connection has been closed locally I can refresh the page every 1 hour or so, but it will cause other problems. How can I set the expiration time? Thanks in advance. bz
Erel B4X founder Staff member Licensed User Longtime User Aug 13, 2014 #2 The inactivity timeout fires after 3 hours. It is important to eventually close inactive connections to avoid "collecting" broken connections. If you want to disable it then you can use a timer that sends a request every few minutes. You can for example get the value of one of the elements. Don't forget to call ws.Flush. Upvote 0
The inactivity timeout fires after 3 hours. It is important to eventually close inactive connections to avoid "collecting" broken connections. If you want to disable it then you can use a timer that sends a request every few minutes. You can for example get the value of one of the elements. Don't forget to call ws.Flush.
B billzhan Active Member Licensed User Longtime User Aug 14, 2014 #3 Thanks, Erel . It does the trick. I find another issue for websocket thread which is not active for a long time. Session will also time out, and I have to set MaxInactiveInterval long enough . Code: Copy ws.Session.MaxInactiveInterval=86400*10 '10days Upvote 0
Thanks, Erel . It does the trick. I find another issue for websocket thread which is not active for a long time. Session will also time out, and I have to set MaxInactiveInterval long enough . Code: Copy ws.Session.MaxInactiveInterval=86400*10 '10days