Interface IIpValidator
Provides methods for validating and parsing IP addresses.
Namespace: Unity.Services.Multiplayer
Assembly: Unity.Services.Multiplayer.dll
Syntax
public interface IIpValidator
Methods
IsValidIPAddress(string)
Checks if the given string is a valid IP address (IPv4 or IPv6).
Declaration
bool IsValidIPAddress(string ip)
Parameters
Type | Name | Description |
---|---|---|
string | ip | The IP address string to validate. |
Returns
Type | Description |
---|---|
bool |
TryParseIPAddress(string, out NetworkEndpointAddress)
Attempts to parse the given string as an IP address.
Declaration
bool TryParseIPAddress(string ip, out NetworkEndpointAddress endpoint)
Parameters
Type | Name | Description |
---|---|---|
string | ip | The IP address string to parse. |
NetworkEndpointAddress | endpoint | When this method returns, contains the parsed NetworkEndpointAddress if the parse succeeded; otherwise, the default value. |
Returns
Type | Description |
---|---|
bool | Returns true if the IP address was successfully parsed; otherwise, false. |