jjzjj

currentReachabilityStatus

全部标签

ios - 使用 Apple 的 Reachability 在 Swift 中检查远程服务器的可达性

我正在开发一个用Swift编写的iOS应用程序,它与本地网络上的HTTP服务器通信,我正在使用Apple的Reachability类来确定运行HTTP服务器的远程机器是否在线。这是代码:...letRemoteHost:String="192.168.178.130"varRemoteReachability:Reachability!=nilvarRemoteIsReachable:Bool=falseinit(){super.init()self.RemoteReachability=Reachability(hostName:self.RemoteHost)NSNotificat

ios - 使用 Apple 的 Reachability 在 Swift 中检查远程服务器的可达性

我正在开发一个用Swift编写的iOS应用程序,它与本地网络上的HTTP服务器通信,我正在使用Apple的Reachability类来确定运行HTTP服务器的远程机器是否在线。这是代码:...letRemoteHost:String="192.168.178.130"varRemoteReachability:Reachability!=nilvarRemoteIsReachable:Bool=falseinit(){super.init()self.RemoteReachability=Reachability(hostName:self.RemoteHost)NSNotificat