【func】ping库

AHK library providing a variety of ICMP pinging-related functionality.

Examples

Ping a Google DNS server:

    MsgBox % “Round trip time: ” . RoundTripTime(“8.8.8.8”)

Ping two different Google DNS servers at the same time:

    Addresses := [“8.8.8.8”, “8.8.4.4”]
    Value := “”
    For Index, PingTime In RoundTripTimeList(Addresses)
        Value .= “Server: “List[Index] . “, Round trip time: ” . PingTime . “ms`n”
    MsgBox %Value%

Send an ICMP request to a Google DNS server:

    MsgBox % “Round trip time: ” . Ping(“8.8.8.8”) . “ms”

Ping example.com with some data and show the response (the SubStr causes the result to be interpreted as a string):

    MsgBox % “Round trip time: ” . Ping(“192.0.43.10″,800,”Hello!”,6,Value,Length) . “ms, Response: ” . SubStr(Value,1)

Overview

All functions throw exceptions on failure.

### RTT := Ping(Address,Timeout = 800,ByRef Data = “”,Length = 0,ByRef Result = “”,ByRef ResultLength = 0)
Pings an address and waits for a response.
Useful for sending custom pings supporting messages and responses.

### RTT := PingAsync(Address,Timeout = 800,ByRef Data = “”,Length = 0,ByRef Result = “”,ByRef ResultLength = 0)
Works exactly the same as Ping(), but uses an asynchronous event-based method.
Intended only as a technology demo, avoid using as it may change or be removed in the future.

### RTT := RoundTripTime(Address,Timeout = 800)
Determines the round trip time (sometimes called the “ping”) from the local machine to the address.
Useful for pinging a server to determine latency.

### RTT := RoundTripTimeList(AddressList,Timeout = 800)
Determines the round trip time (sometimes called the “ping”) from the local machine to a list of 64 or fewer addresses.
Useful for quickly pinging an entire server list to find the amount of latency in the connection to each.

Parameters

RTT:          The round trip time in milliseconds (e.g., 76). If unknown or timed out, this value is -1.
Address:      IPv4 address as a string in dotted number format (e.g., “127.0.0.1”).
AddressList:  Array of IPv4 addresses as strings in dotted number format (e.g., [“127.0.0.1”, “8.8.4.4”]).
Timeout:      How long the function should wait, in milliseconds, before giving an error (e.g., 400).
Data:         The data to send with the ping (e.g., “Hello”). Can be binary data as well.
Length:       The length of the data to send with the ping (e.g., 5).
Result:       The data in the response to the ping (e.g., “Salutations”). Can be binary data as well.
ResultLength: The length of the data in the response to the ping (e.g., 11).

下载权限

查看
  • 免费下载
    评论并刷新后下载
    登录后下载

查看演示

  • {{attr.name}}:
您当前的等级为
登录后免费下载登录 小黑屋反思中,不准下载! 评论后刷新页面下载评论 支付以后下载 请先登录 您今天的下载次数(次)用完了,请明天再来 支付积分以后下载立即支付 支付以后下载立即支付 您当前的用户组不允许下载升级会员
您已获得下载权限 您可以每天下载资源次,今日剩余

给TA捐赠
共{{data.count}}人
人已捐赠
其他

【lib】WinHttp库

2021-10-20 9:52:43

其他函数

【func】html2text函数库

2021-10-20 10:10:54

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索