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
public static ReachableHost GetReachableHost(
	IEnumerable<string> hosts,
	ReachableHostMode failureMode = ReachableHostMode.ReturnFirst


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.
NetworkException Thrown if no hosts are reachable and failureMode is passed as Throw.
See Also