Table of Contents

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

instance string

The optional instance label (e.g. "Living Room").

service string

The service label pair (e.g. "_companion-link._tcp").

domain string

The 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

string

Instance

Gets the optional instance name.

public string? Instance { get; }

Property Value

string

PtrName

Gets just the service name, like the name for a PTR record.

public string PtrName { get; }

Property Value

string

Service

Gets the service label pair (e.g. "_companion-link._tcp").

public string Service { get; }

Property Value

string

Methods

SplitName(string)

Splits a name into instance (optional), service, and domain parts.

public static ServiceInstanceName SplitName(string name)

Parameters

name string

The full name to split.

Returns

ServiceInstanceName

The parsed ServiceInstanceName.

Exceptions

ArgumentException

Thrown when name isn't a service name or service instance name.