开发者

Objective C reachability of LAN devices

开发者 https://www.devze.com 2023-02-18 20:32 出处:网络
I need write a program on Mac OS X to manage some 开发者_如何学运维number of projectors on the LAN (using IP address), and I\'m trying to figure out how to monitor their connection status. Something l

I need write a program on Mac OS X to manage some 开发者_如何学运维number of projectors on the LAN (using IP address), and I'm trying to figure out how to monitor their connection status. Something like a simple ping just to make sure I can reach them.

I've tried using the NSURLRequest requestWithURL call. It worked, but the program stops responding for quite a while if any of the projectors are offline. I'm just looking to get the status and change the UI indication.

Are there better ways to do this? Any help or point in the right direction would be great, thanx.


Try setting the timeoutInterval property on the NSURLRequest. Otherwise you'll have to run the ping connection in a background thread, or else use use NSURLConnect and check the asynchronous callbacks delivered to the delegate.

0

精彩评论

暂无评论...
验证码 换一张
取 消