My two cents: Make your app work via the local database and have a background thread update the server.
Why? No matter how frequent you make your test, Murphy's law tells you that the failure will happen halfway between the two tests.... On Dec 13, 7:50 am, FlyFisher <[email protected]> wrote: > I’m struggling a bit with how to know if my user has an internet > connection so I can disable certain server dependent processes while > they are offline. > > My first inclination is to create a function to be called periodically > (once a minute?) that makes a quick query to the database with a very > short timeout and enable/disable user buttons that need to access the > server based on the success of the database call. My questions about > this solution are > > (1): is this a decent way to test for online/offline?; and > (2) If I have 500 kiosks that are all sending 1 query/minute to test > for connection, is that going to slow down the real data sync > connections that need to take place? > > I’ve also seen a javascript solution with a script in an .js file > (isOnline from Gears FAQ) that runs on a timer in the background and > I’ve been able to get this to work in demos. This solution > essentially uses httprequest to ping a file in the war directory of > the server…but I have 2 issues with that: > > (1) just because I can ping a file doesn’t mean my database server is > up; and > (2) I’m having trouble figuring out how to access the javascript > success/fail variable in my GWT java code. > > Any thoughts you have would be great!
