iOS网络可达性 – 似乎不起作用

前端之家收集整理的这篇文章主要介绍了iOS网络可达性 – 似乎不起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在关注 How to check for an active Internet connection on iOS or OSX?http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html以测试连接性,但我遇到了一些非常基本的问题.

例如,我正在从另一台机器上运行.NET API,然后尝试通过我的mac mini连接到它.

1)当IIS运行时,一切都正常运行,我很高兴我得到了这个工作!

2)我可以完全关闭IIS(很明显,主机无法访问),但我的reachabilityWithHostName仍然报告主机可以访问.

有任何想法吗?

解决方法

SCNetworkReachability Reference.

The SCNetworkReachability programming
interface allows an application to
determine the status of a system’s
current network configuration and the
reachability of a target host. A
remote host is considered reachable
when a data packet,sent by an
application into the network stack,
can leave the local device.
Reachability does not guarantee that
the data packet will actually be
received by the host.

打开和关闭IIS只会阻止您的服务器接收诸如ftp / http之类的Web请求,并且不会阻止设备成功发送数据包.

原文链接:https://www.f2er.com/iOS/327970.html

猜你在找的iOS相关文章