On Jan 28, 2010, at 9:22 PM, Laurent Daudelin wrote: > host = CFHostCreateWithName(kCFAllocatorDefault, (CFStringRef)hostName); > assert(host != NULL); > > SCNetworkReachabilityRef target = > SCNetworkReachabilityCreateWithName(NULL, [hostName > cStringUsingEncoding:NSUTF8StringEncoding]);
It seems redundant to convert the hostname string into a CFHost and then back into a string. Have you verified that you're getting a reasonable C string at the end? > SCNetworkReachabilityGetFlags(target, &flags); Try checking the error code this returns. All the examples I've seen do this asynchronously by setting up a runloop-based callback; I'm not certain that the flags are valid immediately after you create the ref. —Jens_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com