• 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
Re: Am I Connected (Cont)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Am I Connected (Cont)


  • Subject: Re: Am I Connected (Cont)
  • From: Mike Cohen <email@hidden>
  • Date: Mon, 11 Feb 2002 14:34:02 -0500

If you're using a PPP connection won't that cause it to dial?

How about a way to find out if you're connected WITHOUT dialing? I know how
to do it in 9 using MoreNetworkSetup, but how about under X?

On 2/11/02 2:17 PM, "John Cebasek" <email@hidden> wrote:

> 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.
>
>

--
[ Mike Cohen | http://www.macmegasite.com/ ]
[ email@hidden | http://www.worldbeatplanet.com/ ]

Sound is the same for all the world - Youssou N'dour, "Eyes Open"
_______________________________________________
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.

References: 
 >Am I Connected (Cont) (From: John Cebasek <email@hidden>)

  • Prev by Date: Am I Connected (Cont)
  • Next by Date: AirPort & SCF question (X)
  • Previous by thread: Am I Connected (Cont)
  • Next by thread: Re: Am I Connected (Cont)
  • Index(es):
    • Date
    • Thread