ping

How to Perform Multiple “Pings” in Parallel using C#

孤者浪人 提交于 2019-12-17 18:07:23
问题 I am trying to calculate the average round-trip time for a collection of servers. In order to speed things up, I would like to perform the pings in parallel. I have written a function called AverageRoundtripTime() and it seems to work, however, since I don't know very much about multi-threading, I am wondering if what I've done is okay. Please take a look at my code and let me know if it's okay or if there's a better way to achieve what I want: public void Main() { // Collection of hosts.

Send a ping to each IP on a subnet

这一生的挚爱 提交于 2019-12-17 17:25:53
问题 Is there a command line based way to send pings to each computer in a subnet? Like for(int i = 1; i < 254; i++) ping(192.168.1.i); to enforce arp resolution? 回答1: I would suggest the use of fping with the mask option, since you are not restricting yourself in ping. fping -g 192.168.1.0/24 The response will be easy to parse in a script: 192.168.1.1 is alive 192.168.1.2 is alive 192.168.1.3 is alive 192.168.1.5 is alive ... 192.168.1.4 is unreachable 192.168.1.6 is unreachable 192.168.1.7 is

How to run PING command and get ping host summary?

邮差的信 提交于 2019-12-17 16:26:29
问题 Hi I need to execute the PING command using Java code and get summary of the ping host. How to do it in Java? 回答1: as viralpatel specified you can use Runtime.exec() following is an example of it class pingTest { public static void main(String[] args) { String ip = "127.0.0.1"; String pingResult = ""; String pingCmd = "ping " + ip; try { Runtime r = Runtime.getRuntime(); Process p = r.exec(pingCmd); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); String

Delphi (XE2) Indy (10) Multithread Ping

南楼画角 提交于 2019-12-17 15:36:52
问题 I have a room with 60 computers/devices (40 computers and 20 oscilloscopes Windows CE based) and I would like to know which and every one is alive using ping. First I wrote a standard ping (see here Delphi Indy Ping Error 10040), which is working fine now but takes ages when most computers are offline. So what I am trying to do is to write a MultiThread Ping but I am quite struggling with it. I have seen only very few examples over the internet and no one was matching my needs, that's why I

服务器ping不通

血红的双手。 提交于 2019-12-17 10:31:21
故障排错: 交换机 排查 接口与网端是否正确 服务器 若还是ping不通,用另一台电脑连接服务器,手段配置另一台电脑与服务器在同一个网段,查看是否可以ping不通,用别的电脑ping. 来源: CSDN 作者: 禾子日辰 链接: https://blog.csdn.net/qq_42362811/article/details/103460293

iOS - Ping with timeout

我的未来我决定 提交于 2019-12-17 10:29:51
问题 I'm using Apple's "Simple Ping" example and it has almost all features that I need, but I don't know where I can set timeout of each packet. It seems that it isn't possible because function that is used to write data to socket doesn't have any timeout parameters. Does anybody have idea to change this app to get ability to set timeout like in windows ping command? By timeout I mean time for each packet sent to be discarded after waiting for response too long. Windows ping command - timeout I

Ping Application in Android

淺唱寂寞╮ 提交于 2019-12-17 07:15:39
问题 I am making an application which will implement some features of the "ping" command.The problem is, I have no idea of which library/libraries to use in ANDROID. anyone have any idea for it? I have visited these stackoverflow links but they weren't very helpful. Is there a way to make an android device answer to icmp pings addressed to the broadcast address? https://stackoverflow.com/questions/5601513/problem-to-do-ping-with-android Android Debugging InetAddress.isReachable how to icmp ping on

排除网络故障

孤街浪徒 提交于 2019-12-17 07:06:08
对于那些从事网络管理与维护工作或者经常上网的朋友来说,遇到网络故障几乎是一件不可避免的事情。面对稀奇古怪的网络故障,相信不少人会感觉到无从下手,于是他们往往会求助各种专业的故障诊断工具,希望能通过这些专业工具快速找到故障原因,以便及时采取措施进行针对性应对。 事实上,无论是什么类型的故障诊断工具,在一些特殊网络故障面前都会显得无能为力;此时,我们所能做的就是依靠自己,从使用Ping命令开始,手工逐步排查故障原因。 着眼顺序,用好Ping命令 尽管Ping命令平时看上去很平凡稀松,但是在关键时刻使用该命令,它有时能发挥出意想不到的作用。当然,要想让Ping命令有效发挥作用,我们首先需要掌握使用该命令排查故障的一些测试顺序,只要依照顺序依次排查,再难解决的网络故障也能被很快解决掉,下面就是使用Ping命令测试故障原因的具体操作顺序: 首先对本地工作站的循环地址127.0.0.1进行ping测试。当遇到一些无法直接找到故障原因的特殊网络故障时,我们首先需要使用Ping命令测试一下本地工作站的循环地址127.0.0.1能否被正常Ping通,倘若该地址无法被正常Ping通的话,那么说明本地工作站的TCP/IP 协议 程序受到了破坏,或者网卡设备发生了损坏。 此时,我们不妨打开本地工作站系统的设备管理器窗口,从中找到网卡设备选项,并用鼠标右键单击该选项,从弹出的快捷菜单中执行“属性”命令

How to ping a URL in an Android Service?

自闭症网瘾萝莉.ら 提交于 2019-12-17 06:12:45
问题 How can I use Android Service to do a ping callback? I need to open a webpage on a button click, but in the background, go ping another URL for stats collection. 回答1: I think if you just want to ping an url, you can use this code : try { URL url = new URL("http://"+params[0]); HttpURLConnection urlc = (HttpURLConnection) url.openConnection(); urlc.setRequestProperty("User-Agent", "Android Application:"+Z.APP_VERSION); urlc.setRequestProperty("Connection", "close"); urlc.setConnectTimeout(1000

CentOS 6.7安装配置Ansible

大憨熊 提交于 2019-12-17 05:28:30
1、准备CentOS环境 yum update && yum upgrade 2、控制服务器与被管理服务器要求 Master:Python 2.6+ Slave:Python 2.4+,最好也是2.6+(CentOS 6.7自带) 3、配置SSH自动登录 配置Master向每一台Slave的SSH无密码登录(在Master上使用ssh-keygen生成密钥对,并将id_rsa.pub加入到每一个Slave的authorized_keys中) 4、使用yum安装ansible yum install ansible 如果提示没有此安装包,可以加入EPEL扩展包: yum install epel-release yum install ansible 5、配置host 默认在/etc/ansible/hosts,加入Slave的ip地址,例如 [Web] 192.168.1.101 192.168.1.102 192.168.1.103 6、测试 ansible all -m ping 成功ping同后显示 192.168.1.101 | success >> { "changed": false, "ping": "pong" } 192.168.1.102 | success >> { "changed": false, "ping": "pong" } 192.168.1