hs.network.ping
object methods.checksum
- The ICMP packet checksum used to ensure data integrity.code
- ICMP Control Message Code. This should always be 0 unless the callback has received a "receivedUnexpectedPacket" message.identifier
- The ICMP packet identifier. This should match the results of hs.network.ping.echoRequest:identifier unless the callback has received a "receivedUnexpectedPacket" message.payload
- A string containing the ICMP payload for this packet. The default payload has been constructed to cause the ICMP packet to be exactly 64 bytes to match the convention for ICMP Echo Requests.sequenceNumber
- The ICMP Sequence Number for this packet.type
- ICMP Control Message Type. Unless the callback has received a "receivedUnexpectedPacket" message, this will be 0 (ICMPv4) or 129 (ICMPv6) for packets we receive and 8 (ICMPv4) or 128 (ICMPv6) for packets we send._raw
- A string containing the ICMP packet as raw data._raw
field.hs.network.ping.echoRequest.echoRequest(server) -> echoRequestObject
server
- a string containing the hostname or ip address of the server to communicate with. Both IPv4 and IPv6 style addresses are supported.hs.network.ping.ping
constructor and is more difficult to use. It is recommended that you use this constructor only if hs.network.ping.ping
is not sufficient for your needs.hs.network.ping.echoRequest:acceptAddressFamily([family]) -> echoRequestObject | current value
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Get or set the address family the echoRequestObject should communicate with. | | Parameters |family
- an optional string, default "any", which specifies the address family used by this object. Valid values are "any", "IPv4", and "IPv6".hs.network.ping.echoRequest:hostAddress() -> string | false | nil
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Returns a string representation for the server's IP address, or a boolean if address resolution has not completed yet. | | Parameters |hs.network.ping.echoRequest:hostAddressFamily() -> string
hs.network.ping.echoRequest:hostName() -> string
hs.network.ping.echoRequest:identifier() -> integer
hs.network.ping.echoRequest:isRunning() -> boolean
hs.network.ping.echoRequest:nextSequenceNumber() -> integer
hs.network.ping.echoRequest:seeAllUnexpectedPackets([state]) -> boolean | echoRequestObject
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Get or set whether or not the callback should receive all unexpected packets or only those which carry our identifier. | | Parameters |state
- an optional boolean, default false, specifying whether or not all unexpected packets or only those which carry our identifier should generate a "receivedUnexpectedPacket" callback message.hs.network.ping.echoRequest:sendPayload([payload]) -> echoRequestObject | false | nil
| | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Sends a single ICMP Echo Request packet. | | Parameters |payload
- an optional string containing the data to include in the ICMP Echo Request as the packet payload.hs.network.ping.echoRequest:setCallback(fn) -> echoRequestObject
fn
- a function to set as the callback function for this object, or nil if you wish to remove any existing callback function.hs.network.ping.echoRequest:start() -> echoRequestObject
hs.network.ping.echoRequest:stop() -> echoRequestObject