server connection lost, herconnecting

Questions and answers on developing, deploying and using plugins and JavaBeans

server connection lost, herconnecting

Postby nic » Tue Sep 29, 2020 4:30 pm

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?
nic
 
Posts: 18
Joined: Fri Nov 16, 2018 10:54 am

Re: server connection lost, herconnecting

Postby rph » Tue Oct 20, 2020 6:05 pm

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?
rph
 
Posts: 51
Joined: Wed Aug 10, 2011 11:44 am
Location: Cham, Switzerland

Re: server connection lost, herconnecting

Postby jcompagner » Fri Oct 23, 2020 6:17 pm

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.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8460
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: server connection lost, herconnecting

Postby nic » Tue Nov 03, 2020 4:44 pm

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?
nic
 
Posts: 18
Joined: Fri Nov 16, 2018 10:54 am


Return to Plugins and Beans

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron