if(data.Length==0)thrownewArgumentException("data cannot be an empty string.",nameof(data));
if(!LineTerminators.Any(data.Contains))thrownewArgumentException("data is not a valid request, it does not contain any CRLF/LF terminators.",nameof(data));
if(data==null)
{
thrownewArgumentNullException(nameof(data));
}
if(data.Length==0)
{
thrownewArgumentException("data cannot be an empty string.",nameof(data));
}
if(!LineTerminators.Any(data.Contains))
{
thrownewArgumentException("data is not a valid request, it does not contain any CRLF/LF terminators.",nameof(data));
if(versionSeparatorIndex<=0||versionSeparatorIndex==versionData.Length)thrownewArgumentException("request header line is invalid. Http Version not supplied or incorrect format.",nameof(versionData));
if(device.RootDevice!=null&&device.RootDevice!=this.ToRootDevice())thrownewInvalidOperationException("This device is already associated with a different root device (has been added as a child in another branch).");
if(device==this)thrownewInvalidOperationException("Can't add device to itself.");
if(searchTarget.Length==0)thrownewArgumentException("searchTarget cannot be an empty string.",nameof(searchTarget));
if(searchWaitTime.TotalSeconds<0)thrownewArgumentException("searchWaitTime must be a positive time.");
if(searchWaitTime.TotalSeconds>0&&searchWaitTime.TotalSeconds<=1)thrownewArgumentException("searchWaitTime must be zero (if you are not using the result and relying entirely in the events), or greater than one second.");
thrownewArgumentException("searchWaitTime must be zero (if you are not using the result and relying entirely in the events), or greater than one second.");
thrownewArgumentException("osName cannot be an empty string.",nameof(osName));
}
if(osVersion==null)
{
thrownewArgumentNullException(nameof(osVersion));
}
if(osVersion.Length==0)
{
thrownewArgumentException("osVersion cannot be an empty string.",nameof(osName));
}
_SupportPnpRootDevice=true;
_Devices=newList<SsdpRootDevice>();
@ -82,7 +105,10 @@ namespace Rssdp.Infrastructure
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "t", Justification = "Capture task to local variable supresses compiler warning, but task is not really needed.")]