Re: Are you on-line?
Re: Are you on-line?
- Subject: Re: Are you on-line?
- From: Markus Hitter <email@hidden>
- Date: Thu, 1 Nov 2001 09:45:45 +0100
Am Donnerstag den, 1. November 2001, um 07:40, schrieb Johnny CN Lee:
However, I may be on the road and off-line. So I want this app
can check if I'm on-line before connecting to the remote server
and get errors.
Even if you are "online", your connection attempt can fail, so
you have to be prepared to handle this anyway. Simply waiting
for a connection won't take up much resources.
Try to ping two different servers. If one goes and the other
fails, you detected trouble. Or ping your router at home, which
is very unlikely to go down but would respond to pings.
Then, there is SCNetworkCheckReachabilityByName(); which detects
wether the internal modem needs to dial to get a connection. You
can ask Chad Jones from Apple DTS for a code snippet.
Hope that helps,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/