• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Am I Connected (Cont)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Am I Connected (Cont)
      • From: Jens Bauer <email@hidden>
    • Re: Am I Connected (Cont)
      • From: Mike Cohen <email@hidden>
  • Prev by Date: Re: Am connected to Internet?
  • Next by Date: Re: Am I Connected (Cont)
  • Previous by thread: Re: Am connected to Internet?
  • Next by thread: Re: Am I Connected (Cont)
  • Index(es):
    • Date
    • Thread