On Sun, 2009-12-20 at 10:36 +1000, Angus Mann wrote: > Why can't you put the update on the same LAN server that the app resides? > > If that is not possible, what about using CURL, and update if it can connect > successfully, but don't if it cannot? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > Since the LAN is remote (many hundreds of miles away) from the source > of the update, the only practical way to deliver an update every month or > week to multiple users is to make it available for download from a central > "update server". > > I'm just trying to maximize efficiency by checking if an internet > connection exists, and abandoning further attempts to check for update > availability if it does not. > > The idea to use CURL seems valid, but it pre-supposes that I know the > answer to my own question. To use your suggestion, I'd have to have some > mechanism to detect if it "can connect successfully". I'm asking what that > mechanism should be, and if the one I've suggested is good, or flawed in some > way. > > > >
I think the only way to detect if it can connect to the Internet is to see if you can grab a file from somewhere on the Internet. I'd hazard a guess that when operating systems are able to tell you they can "connect to the Internet" they are actually saying they can ping a predetermined remote host. I think checking if PHP can grab a remote file with Curl would be sufficient in this case. Thanks, Ash http://www.ashleysheridan.co.uk