Page 1 of 1

server connection lost, herconnecting

PostPosted: Tue Sep 29, 2020 4:30 pm
by nic
When I have a Android (or IOS) device connected to the server with the Phonegap plugin, I get a message on my screen after about 10 minutes of inactivity : “server connection verloren, herconnecting”.
But instead of reconnecting to the server, the client connection is terminated and a new one is started. This results in that I get the login screen and I have to login the system again.

In the servoy logfiles I see a warning at the reconnection moment:
2020-09-29 15:17 https-jsse-nio-443-exec-4 WARN org.sablo.websocket.WebsocketEndpoint Cannot find httpsession for websocket session, server restarted? clientnr=2, winnr=1, winname=null, connectnr: [2976373605682]

But the server is not restarted.

What is happening in the client connection after 10 minutes?

Is is there a way to prolong this period or even better to prevent this behaviour?

Re: server connection lost, herconnecting

PostPosted: Tue Oct 20, 2020 6:05 pm
by rph
Hi

We also often see such log entries "Cannot find httpsession for websocket session, server restarted? ...". Have you found out anything in the meantime? Or does somebody else have any ideas what happens here?

Re: server connection lost, herconnecting

PostPosted: Fri Oct 23, 2020 6:17 pm
by jcompagner
this is just tricky we can't do much about this

What happens here is that the OS suspends that app, if there is no websocket ping/pong between client and server, (we try to force a ping pong even from the server, but if the client dus kills that then that also doesn't come over)
Then after 60 seconds (default sablo.session.timeout) we kill the client. So when you then resume the client app it tries to reconnect but doesn't find anything.
Then it also can be that the the http session is already gone, if that happens we need a full restart (so really the index.html page needs to be hit again), this http session is controlled by us, if we see that the last client is gone we kill the http session.

So very likely the ngclient is already gone (you can see that from the admin page) then it tries to connect first directly through the websocket
But there is no client anymore and there is also no http session anymore so you get that warning in the log (i can improve that log file to make that more clear), then first a full refresh needs to happen.

The only way around this is to adjust the sablo websocket time out, so that even without a active websocket connection we don't kill everything after 60 seconds.

Re: server connection lost, herconnecting

PostPosted: Tue Nov 03, 2020 4:44 pm
by nic
Hi Johan, thanks for the advice.

I have changed the sablo.session.timeout to 8 hours and now the session reconnects ok.

The only thing that is disturbing now is that the busy indicator (the five dots in the footer) is continously visible.

Is there somthing I can do about that?