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:
|
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:
|
Signature | hs.network.ping:cancel() -> none |
---|---|
Type | Method |
Description | Cancels an in progress ping process, terminating it immediately Parameters:
Returns:
Notes:
|
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:
|
Signature | hs.network.ping:isPaused() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ping process is currently paused. Parameters:
Returns:
|
Signature | hs.network.ping:isRunning() -> boolean |
---|---|
Type | Method |
Description | Returns whether or not the ping process is currently active. Parameters:
Returns:
Notes:
|
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:
|
Signature | hs.network.ping:pause() -> pingObject | nil |
---|---|
Type | Method |
Description | Pause an in progress ping process. Parameters:
Returns:
|
Signature | hs.network.ping:resume() -> pingObject | nil |
---|---|
Type | Method |
Description | Resume an in progress ping process, if it has been paused. Parameters:
Returns:
|
Signature | hs.network.ping:sent() -> integer |
---|---|
Type | Method |
Description | Returns the number of ICMP Echo Requests which have been sent. Parameters:
Returns:
|
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:
|
Signature | hs.network.ping:setCallback(fn | nil) -> pingObject |
---|---|
Type | Method |
Description | Set or remoce the callback function for the pingObject. Parameters:
Returns:
Notes:
|
Signature | hs.network.ping:summary() -> string |
---|---|
Type | Method |
Description | Returns a string containing summary information about the ping process. Parameters:
Returns:
Notes:
|