Class UdpHealthChecker
- Namespace
- AppHealthMonitor
- Assembly
- AppHealthMonitor.dll
Checks port health by attempting to send a UDP datagram.
Limitation: UDP is connectionless. A successful send only confirms the local OS accepted the datagram into the send buffer, not that the remote endpoint received it or is alive. This checker will report success even if the target application is down. For reliable health checking, prefer TCP or WebSocket. Use UDP checks only as a supplementary probe alongside other port types.
public sealed class UdpHealthChecker : IHealthChecker
- Inheritance
-
UdpHealthChecker
- Implements
- Inherited Members
Properties
PortType
Gets the port type this health checker handles.
public PortType PortType { get; }
Property Value
Methods
IsResponsiveAsync(string, int, int, CancellationToken)
Checks if the specified port is responsive.
public Task<bool> IsResponsiveAsync(string host, int port, int timeoutMilliseconds, CancellationToken cancellationToken)
Parameters
hoststringThe hostname or IP address to check.
portintThe port number to check.
timeoutMillisecondsintThe timeout in milliseconds before the check is considered failed.
cancellationTokenCancellationTokenToken to signal cancellation of the check.