Q42.HueApi.LocalHueClient.CheckValidIp C# (CSharp) Method

CheckValidIp() private method

Check if the provided IP is valid by using it in an URI to the Hue Bridge
private CheckValidIp ( string ip ) : void
ip string
return void
	private void CheckValidIp(string ip)
	{
		Uri uri;
		if (!Uri.TryCreate(string.Format("http://{0}/description.xml", ip), UriKind.Absolute, out uri))
		{
			//Invalid ip or hostname caused Uri creation to fail
			throw new Exception(string.Format("The supplied ip to the HueClient is not a valid ip: {0}", ip));
		}
	}