ping

How to read the particular value from Ping result

回眸只為那壹抹淺笑 提交于 2019-12-08 08:59:17
问题 I am trying to read values from below ping results, like I want to read Received value as 4 or Lost value as 0 using regular expression. Ping statistics for 74.125.200.94: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 63ms, Maximum = 64ms, Average = 63ms I am trying with below but no go, Any help? $test = ping google.co.in $test -match "^Average = \((\d+)\)$" 回答1: Just use [regex]::Match to grab the information: $test = ping

Launch and write to terminal in Qt

时间秒杀一切 提交于 2019-12-08 07:58:23
问题 I am coding in linux using Qt. I understand that with popen or QProcess I can launch terminal from my program, but how do I write into to it? I google around people are suggesting fork() and pipe(). My purpose is to do an ICMP ping with the terminal, and stop when ping successfully. I made it with popen, but I couldn't stop the ping process thus my program won't run. 回答1: You don't write anything to terminal because there's no terminal. You pass name of a program to run and its arguments as

Ping from browser [duplicate]

一曲冷凌霜 提交于 2019-12-08 07:27:21
问题 This question already has answers here : Is it possible to ping a server from Javascript? (16 answers) Closed 5 years ago . I have an HTML page which I want to test a ping from. I want a user to connect to the website and in the main page he will get a result of the round trip from his computer to a specific server. Should I use "Ping"? I heard about something called applicable ping but it's something that I need to build myself and I don't know how.. Please help 回答1: Ping is just the measure

Do not receive echo-reply from ping request with scapy

断了今生、忘了曾经 提交于 2019-12-08 07:17:16
问题 I use scapy and try to make a ping and receive the reply. my_ping = Ether() / IP(dst='8.8.8.8') / ICMP() rep,no_rep = srp(my_ping) The problem is that I don't receive any answer. The ping 8.8.8.8 works well using the terminal. I've this problem on my Mac (OS X 10.10 Yosemite) and also on the Ubuntu VM installed on my Mac. However, those commands work on my AWS Ubuntu machine. If somebody has a clue... feel free to answer 来源: https://stackoverflow.com/questions/27167069/do-not-receive-echo

Ping a Bluetooth device from an Android device

旧巷老猫 提交于 2019-12-08 06:47:53
问题 I would like to know if a Bluetooth device given its MAC address is available (on and within reach) or not. Something like a ping, some quick method. I tried to check by trying to establish a connection but it takes up to 12 seconds. Do you know any faster way? 回答1: If the device you are looking for is discoverable then doing a device discovery is probably the most efficient. 来源: https://stackoverflow.com/questions/6281231/ping-a-bluetooth-device-from-an-android-device

Android strange cross device behaviour

送分小仙女□ 提交于 2019-12-08 06:08:49
问题 I have three android devices, a Samsung Galaxy Note 10 an HTC Desire C and a Sony Xperia E. As well i have a service that listens on a specific TCP port on these devices. The WIFI policy is set to "Always on" in all of my devices as well my service acquires a WIFI_MODE_FULL and a PARTIAL_WAKE_LOCK so the CPU and WIFI are always there. After some time when i want to connect to these devices from the server something bad happens. The Samsung Galaxy Note device always behaves correctly. HTC

Is there a way to treat Ping-Host as a boolean in PowerShell?

落爺英雄遲暮 提交于 2019-12-08 05:20:58
问题 I'd like to do something like this: if (Ping-Host server1) { blah } Anyone know of a simple way? 回答1: Something like this? if ($(Ping-Host server1 -count 1 -timeout 10).received -eq 1) { blah } 回答2: If you are on PowerShell 2.0 I would recommend using Test-Connection -Quiet. It returns a simple true or false indicating whether or not the host can be reached via ping. BTW one of the benefits of Test-Connection is it's built-in whereas ping-host isn't. 来源: https://stackoverflow.com/questions

Multicast Ping (Windows)

倾然丶 夕夏残阳落幕 提交于 2019-12-08 05:01:06
问题 I am trying to implement server auto discovery so that clients will be able to see a list of servers available to connect to. I would like to auto discover servers even if they are in different subnets. I have read that windows does not respond to broadcast ping, but is it possible to make all these servers to join a multicast group and use multicast ping on the group to see what servers are up? Thanks 回答1: Try Zero configuration networking (Zeroconf). Note multiple LAN segments requires

Window通过cmd命令测试服务器带宽性能的方法(IP测试)

[亡魂溺海] 提交于 2019-12-08 04:38:08
一、我分别使用三台香港云服务器来测试: 1号 39.109.122.213 2号 144.48.8.152 3号 103.212.32.208 二、在cmd里输入第一条命令: ping ip地址 -t ping返回的参数说明: <字节> :表示发送到服务器的数据包大小 <时间> :响应的时间 <TTL> :生存时间(Time To Live),数据包被路由器丢弃之前允许通过的最大网段数量。 1、字节是固定的,ping都是发送32字节的数据包。 2、响应时间当然是越小越好,数值越小,网络延迟越低,带宽就越好! 3、TTL用来计算数据包在路由器的消耗时间,因为现在绝大多数路由器的消耗时间都小于1s,而时间小于1s就当1s计算,所以数据包每经过一个路由器节点TTL都减一。 4、不同的操作系统,TTL的初始值都不同: Linux系统 TTL值为 64 或 255 WindowsNT/2000/XP系统 TTL值为 128 Windows98系统 TTL值为 32 UNIX主机 TTL值为 255 “TTL”的值越大越好,因为“TTL”的值越大,说明发送数据包经过路由器越少,而经过路由器越少,说明越快到达目的地,速度当然也就越快。 三、一起来看一下刚才那3台云服务器ping的结果: 1号 39.109.122.213 2号 144.48.8.152 3号 103.212.32.208

网络测试的window bat脚本分析

爱⌒轻易说出口 提交于 2019-12-08 04:37:48
测试脚本内容如下: @ echo off :: 设置窗口底色为绿色 color 2 F title 网络连通性检测 echo . echo . ping -n 2 223 . 5 . 5 . 5 > %temp% \ 1 . ping & ping -n 2 223 . 6 . 6 . 6 >> %temp% \ 1 . ping :: ping 阿里公共DNS findstr "TTL" %temp% \ 1 . ping > nul if %errorlevel% == 0 ( echo √ 外网正常) else ( echo × 外网不通) ::根据返回值输出 echo . ping -n 2 192 . 168 . 0 . 1 > %temp% \ 2 . ping findstr "TTL" %temp% \ 2 . ping > nul if %errorlevel% == 0 ( echo √ 网关正常) else ( echo × 网关不通) echo . ping -n 2 192 . 168 . 0 . 3 > %temp% \ 3 . ping findstr "TTL" %temp% \ 3 . ping > nul if %errorlevel% == 0 ( echo √ 内网正常) else ( echo × 内网不通) echo . ping -n