异步网络接口状态检查 [英] Asynchronous network interface status check

查看:201
本文介绍了异步网络接口状态检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Mac OS X中,有没有办法让异步通知时,网络接口(EN0,EN1)状态的变化,如网络接口是有效,无效等?

On Mac OS X, is there a way to get asynchronous notification when the network interface (en0, en1) status changes, such as network interface is active, inactive etc?

相反轮询的状态,我想知道有没有办法让异步通知,因此只要有变化,通知被触发,应用程序可以处理它。

Instead of polling for the status, i would like to know is there a way to get asynchronous notification, so that whenever there is a change, notification is fired and app can handle it.

这可能吗?

谢谢,

推荐答案

检查最多的回答<一个href=\"http://stackoverflow.com/questions/1083701/how-to-check-for-an-active-internet-connection-on-iphone-sdk\">here.这是iOS的SDK,但提到SystemConfigration框架可在Mac OSX上了。

Check the top answer here. It is for the iOS SDK but the SystemConfigration framework mentioned is available on Mac OSX too.

这篇关于异步网络接口状态检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆