Got a question on Web2.0 and browser reconnections…
Web1.0 had gotten pretty good with automatically reconnecting to the web server if the server connection went down and later came back up. I mean it got really good.
With my first Web2.0 project, I see now see the below message:
But the reconnection never seems to occur. Is there a timeout limit? I have a digital signage player that is displaying this web app. If I have to reset the server, I have to then reset the signage player as well which is a pain. The old aggressive reconnect of Web1.0 worked much better for this. Is there a setting I am missing? Is there a way to make Web2.0 behave like that?
I had some trouble with this early on and wrote a little JavaScript method to check for disconnects and reload the page when the server came back up. It uses a 10 second timeout, which can be changed in the last JS line. Put this in Session.Opening:
Your code detects when the connection to the server has come back but unfortunately, it doesn’t always load the page. Sometimes the webpage comes back like it should. Other times you just get white browser window after it loads.
Oh well, I guess I just have to wait for Xojo to implement my feature request…
Well, this does reload the page but I am also seeing it kill the web app. I’m seeing it reload the page but then after the page is reloaded, the web app quits. Seems to fail silently. If I remove this code, then it is solid. Not sure if it is this code or something else…
It would have to be somewhere else. This operates entirely client-side and only when the connection is lost. Not sure what the other issue is or where it could be coming from, but it’s not this.
– Anthony
Interesting. Because when I have this running, the app quits just after reloading. I comment this out and things seem fine. What is odd is that I can’t get it to happen in the debugger.
OK. I think I might know what was happening. I threw in a number of calls to write data to a TextOutputStream as I was trying to track down a bug that I couldn’t figure out. I think what might have been happening is that with multiple clients attempting to reload data at the same time, it was causing an IO Exception to happen and I’ve seen times in the past when these happen silently. I’ve removed the code to write to the TextOutputStream and things seem a lot more stable with your code in place.