Am I Connected (Cont)
Am I Connected (Cont)
- Subject: Am I Connected (Cont)
- From: John Cebasek <email@hidden>
- Date: Mon, 11 Feb 2002 14:17:40 -0500
Hi Quinn:
Talking to the other folks in how they would do this, it seems one
approach would be to send an ECHO command/packet/whatever to a known address
and if the round trip time is > 0, then we're online and connected to the
'net.
I thought that there would be a simpler way to do this, and came up
with:
>
static Boolean ConnectedToInternet(void)
>
{
>
>
InetSvcRef internetServices = kOTInvalidProviderRef;
>
OSStatus osErr = noErr;
>
Boolean bResult = false;
>
internetServices = OTOpenInternetServices(kDefaultInternetServices,
>
0,
&osErr);
if (osErr == noErr)
{
>
bResult = true; // Yippee! We're connected!
>
OTCloseProvider(internetServices);
>
>
}
>
return bResult;
>
}
>
>
My idea was that if OTOpenInternetServices worked, then the user
>
configuration was correct, and we can get to 'the wall'. I wasn't really
>
sure about needing a target to try and reach...
>
>
Except for the fact that OTOpenInternetServices isn't in carbon. Which
>
now
>
has me looking thru tn1173.
>
>
Also, if tn1145 is for OS 9, and those System Config calls are for X, does
>
it mean that there isn't a solution that covers both OSes? We're a
>
powerplant app and I've got carbonized GUSI in there now which seems to be
>
doing quite a bit of the work we need in regards to getting data down from
>
the server in my test harnesses.
>
Well, that's my flaky logic... such that it is...
Best Regards
John Cebasek
email@hidden
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.