Class ServiceInstanceName
- Namespace
- AppleTvControlLibrary.Discovery.Dns
- Assembly
- AppleTvControlLibrary.Discovery.dll
Represents either a service or service instance name in the DNS, handling periods embedded in the instance name correctly.
public sealed class ServiceInstanceName
- Inheritance
-
ServiceInstanceName
- Inherited Members
Remarks
Initializes a new instance of the ServiceInstanceName class.
Constructors
ServiceInstanceName(string?, string, string)
Represents either a service or service instance name in the DNS, handling periods embedded in the instance name correctly.
public ServiceInstanceName(string? instance, string service, string domain = "local")
Parameters
instancestringThe optional instance label (e.g. "Living Room").
servicestringThe service label pair (e.g. "_companion-link._tcp").
domainstringThe domain, defaulting to "local".
Remarks
Initializes a new instance of the ServiceInstanceName class.
Properties
Domain
Gets the domain (typically "local").
public string Domain { get; }
Property Value
Instance
Gets the optional instance name.
public string? Instance { get; }
Property Value
PtrName
Gets just the service name, like the name for a PTR record.
public string PtrName { get; }
Property Value
Service
Gets the service label pair (e.g. "_companion-link._tcp").
public string Service { get; }
Property Value
Methods
SplitName(string)
Splits a name into instance (optional), service, and domain parts.
public static ServiceInstanceName SplitName(string name)
Parameters
namestringThe full name to split.
Returns
- ServiceInstanceName
The parsed ServiceInstanceName.
Exceptions
- ArgumentException
Thrown when
nameisn't a service name or service instance name.