Click or drag to resize

NetUtilityResolve Method (String, NullableAddressFamily)

Get IPv4 or IPv6 address from notation (xxx.xxx.xxx.xxx or xxxx:xxxx:...:xxxx) or hostname, taking in an allowed address family to filter resolved addresses by.

Namespace:  Internal.Lidgren.Network
Assembly:  NeoAxis.Core (in NeoAxis.Core.dll) Version: 2024.1.1.0 (2024.1.1.0)
Syntax
C#
public static IPAddress Resolve(
	string ipOrHost,
	Nullable<AddressFamily> allowedFamily
)

Parameters

ipOrHost
Type: SystemString
The hostname or IP address to parse.
allowedFamily
Type: SystemNullableAddressFamily
If not null, the allowed address family to return.

Return Value

Type: IPAddress
A resolved address matching the specified filter if it exists, null if no such address exists or a lookup error occured.
Exceptions
ExceptionCondition
ArgumentExceptionipOrHost is null or empty OR allowedFamily is not one of null, InterNetwork or InterNetworkV6
Remarks
If allowedFamily is not null, the address returned will only be of the specified family.
See Also