Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

behaviour of SCNetworkCheckReachablityByName



Hi All,
In my application I will have to check at regular interval if a computer is connected to network or not. To implement this funtionality I was checking the behaviour of SCNetworkCheckReachablityByName.
Below is the code snippet:
 
SCNetworkConnectionFlags status;
BOOL result;
result=SCNetworkCheckReachabilityByName("XYZ",&status);
 
NSLog(@"Result= %d status=%d",result,status);
 
Output is always Result=1 status=0 whether "XYZ" computer is connected to network or not. If I include domain name computer name as follow:
 
 
SCNetworkConnectionFlags status;
BOOL result;
result=SCNetworkCheckReachabilityByName("XYZ.MyDomain.com",&status);
 
NSLog(@"Result= %d status=%d",result,status);
 
Then output is always "Result=1 status=2"  whether computer is connected to network or not.
Can someone explain this behaviour? Is that behaviour correct? Please also suggest if I'm using the right approach to check if a computer is connected to network or not.
 
Thanks,
Gurmit
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/macnetworkprog/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.