This module provides a basic ping function which can test host availability. Ping is a network diagnostic tool commonly found in most operating systems which can be used to test if a route to a specified host exists and if that host is responding to network traffic.
Signature | hs.network.ping.ping(server, [count], [interval], [timeout], [class], [fn]) -> pingObject |
---|---|
Type | Constructor |
Description | Test server availability by pinging it with ICMP Echo Requests. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/network/ping/network_ping.lua line 340 |
Signature | hs.network.ping:address() -> string |
---|---|
Type | Method |
Description | Returns a string containing the resolved IPv4 or IPv6 address this pingObject is sending echo requests to. |
Parameters |
|
Returns |
|
Source | extensions/network/ping/network_ping.lua line 186 |
Signature | hs.network.ping:cancel() -> none |
---|---|
Type | Method |
Description | Cancels an in progress ping process, terminating it immediately |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/network/ping/network_ping.lua line 251 |
Signature | hs.network.ping:count([count]) -> integer | pingObject | nil |
---|---|
Type | Method |
Description | Get or set the number of ICMP Echo Requests that will be sent by the ping process |
Parameters |
|
Returns |
|
Source | extensions/network/ping/network_ping.lua line 106 |
Signature | hs.network.ping:isPaused() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ping process is currently paused. |
Parameters |
|
Returns |
|
Source | extensions/network/ping/network_ping.lua line 173 |
Signature | hs.network.ping:isRunning() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ping process is currently active. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/network/ping/network_ping.lua line 157 |
Signature | hs.network.ping:packets([sequenceNumber]) -> table |
---|---|
Type | Method |
Description | Returns a table containing information about the ICMP Echo packets sent by this pingObject. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/network/ping/network_ping.lua line 199 |
Signature | hs.network.ping:pause() -> pingObject | nil |
---|---|
Type | Method |
Description | Pause an in progress ping process. |
Parameters |
|
Returns |
|
Source | extensions/network/ping/network_ping.lua line 70 |
Signature | hs.network.ping:resume() -> pingObject | nil |
---|---|
Type | Method |
Description | Resume an in progress ping process, if it has been paused. |
Parameters |
|
Returns |
|
Source | extensions/network/ping/network_ping.lua line 88 |
Signature | hs.network.ping:sent() -> integer |
---|---|
Type | Method |
Description | Returns the number of ICMP Echo Requests which have been sent. |
Parameters |
|
Returns |
|
Source | extensions/network/ping/network_ping.lua line 131 |
Signature | hs.network.ping:server() -> string |
---|---|
Type | Method |
Description | Returns the hostname or ip address string given to the hs.network.ping.ping constructor. |
Parameters |
|
Returns |
|
Source | extensions/network/ping/network_ping.lua line 144 |
Signature | hs.network.ping:setCallback(fn) -> pingObject |
---|---|
Type | Method |
Description | Set or remove the callback function for the pingObject. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/network/ping/network_ping.lua line 265 |
Signature | hs.network.ping:summary() -> string |
---|---|
Type | Method |
Description | Returns a string containing summary information about the ping process. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/network/ping/network_ping.lua line 231 |