Skip to main content

Function: performSinglePingCheck()

performSinglePingCheck(host: string, timeout: number): Promise<MonitorCheckResult>

Defined in: electron/services/monitoring/utils/pingRetry.ts:89

Performs a single connectivity check without retry logic.

Parameters

host

string

Target hostname, IP address, or URL to check connectivity for.

timeout

number

Maximum time to wait for the connectivity response in milliseconds.

Returns

Promise<MonitorCheckResult>

A promise that resolves to a MonitorCheckResult with connectivity status and timing.

Remarks

This function performs a single connectivity attempt to the specified host using native Node.js modules. It automatically detects HTTP/HTTPS URLs and uses appropriate connectivity check methods (HTTP for URLs, TCP/DNS for hosts). This function is used internally by performPingCheckWithRetry and can also be used directly for single-attempt checks.

Uses native connectivity checking with TCP port scanning and DNS resolution for maximum compatibility without requiring elevated privileges.

Throws

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error if the connectivity operation fails or times out.

See