Click or drag to resize

NetHelperGetReachableHost Method

Pings one or more hostnames or IP addresses in parallel to identify one that appears to be online and reachable via the network (because it answers a ping).

Namespace:  Neon.Net
Assembly:  Neon.Common (in Neon.Common.dll) Version: 2.4.1
Syntax
public static ReachableHost GetReachableHost(
	IEnumerable<string> hosts,
	ReachableHostMode failureMode = ReachableHostMode.ReturnFirst
)

Parameters

hosts
Type: System.Collections.GenericIEnumerableString
The hostname or IP addresses to be tested.
failureMode (Optional)
Type: Neon.NetReachableHostMode
Specifies what should happen when there are no reachable hosts. This defaults to ReturnFirst.

Return Value

Type: ReachableHost
A ReachableHost instance describing the host or null.
Exceptions
ExceptionCondition
NetworkException Thrown if no hosts are reachable and failureMode is passed as Throw.
See Also