最近用到相应功能,网上搜了下. 感谢网友的分享,原文链接如下:http://blog.csdn.net/nanfeiyannan/article/details/6636280 稍微更改了内容,代码如下: unit uPing; interface uses WinSock, Windows; type PIPOptionInformation = ^TIPOptionInformation; TIPOptionInformation = packed record TTL: Byte; TOS
PING (Packet Internet Groper),因特网包探索器,用于测试网络连接量检查网络是否连通,可以很好地帮助我们分析和判定网络故障.Ping发送一个ICMP(Internet Control Messages Protocol)即因特网信报控制协议:回声请求消息给目的地并报告是否收到所希望的ICMP echo(ICMP回声应答).它是用来检查网络是否通畅或者网络连接速度的命令. 它所利用的原理是这样的:利用网络上机器IP地址的唯一性,给目标IP地址发送一个数据包,再要求对方返回
# -*- coding: utf-8 -*- import os # 参考文档: # Ping to a specific IP address using python [duplicate] # http://stackoverflow.com/questions/25842744/ping-to-a-specific-ip-address-using-python # if os.system("ping -c 1 www.baidu.com") == 0: # error:
-a Audible ping. #Audible ping. -A Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered probe is present in the network. Minimal interval is 200msec for not super