electron/services/monitoring/PortMonitor
TCP/UDP port monitoring service for network connectivity health checks.
Remarks
Provides comprehensive port monitoring capabilities for TCP and UDP endpoints with configurable timeouts, retry logic, and intelligent connection handling. Designed for reliable network connectivity verification across various protocols.
Example
const portMonitor = new PortMonitor({ timeout: 5000 });
const result = await portMonitor.check({
id: "mon_1",
type: "port",
host: "example.com",
port: 443,
status: "pending",
// ... other monitor properties
});
console.log(
`Status: ${result.status}, Response time: ${result.responseTime}ms`
);
See
- IMonitorService for interface contract
- MonitorConfig for configuration options