如何在iPhone中Ping或检查特定IP地址的服务器是否可用/已连接 [英] How to Ping or check if server of particular IP Address is available/connected in iPhone

查看:283
本文介绍了如何在iPhone中Ping或检查特定IP地址的服务器是否可用/已连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望Ping或查找服务器的特定IP地址,如果它在特定时间连接或可用,或者不在我的iPhone应用程序中。

I want to Ping or Lookup a particular IP address of server if it is connected or available at that particular time or not in my iPhone application.

我搜索了一个很多互联网,但找不到任何相关的结果。

I searched a lot over internet but could not find any relevant result for same.

请帮助我,因为我是这个领域的新手。

Please help me as I am new to this field.

提前致谢。

推荐答案

Apple提供可以使用该课程的可达性课程和

Apple provides reachability classes you can use the class and

您可以下载 reachability.h Reachability.m

并将其用作

Reachability* reachability = [[Reachability reachabilityWithHostName: @"www.apple.com"] retain];
NetworkStatus netStatus = [reachability currentReachabilityStatus];

netStatus给出了服务器的可达性。

netStatus gives the reachabilty of the server.

这篇关于如何在iPhone中Ping或检查特定IP地址的服务器是否可用/已连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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