Open source

PingDetail

Data you receive as a parameter in the ping callback.

Properties

PropertyTypeDescription
alivebooleanIndicates whether the target is reachable (if an echo reply was received).
targetstringHostname or IP address that was pinged.
target_ipstringTarget IP address that was pinged.
target_ip_versionIPTarget IP version that was used for the ping request. Valid values are "ip4" and "ip6".
sent_atnumberTimestamp when the request was sent. Value is in UTC milliseconds since the Unix epoch.
received_atnumberTimestamp when the response was received. Value is in UTC milliseconds since the Unix epoch.
ttlnumberTime to live from the echo reply, if a response was received.
idnumberIdentifier for the ICMP session from the echo reply, if a response was received.
seqnumberSequence number for the ICMP echo request from the echo reply, if a response was received.
sizenumberSize of the ICMP echo reply, if a response was received.
optionsPingOptionsPing options used for the request.

PingCallback

Callback function for ping results. This function is called for every echo packet sent. If the deadline is exceeded, it is not called for the remaining packets. If the echo response has been received, the error value will be null, otherwise it contains the error.

Signature

JavaScript
(err, data) => void

Parameters

ParameterTypeDescription
errError | nullError object if an error occurred, otherwise null.
dataPingDetailData about the ping attempt, including timing and echo details.