Class StaticCompanionDiscovery
- Namespace
- AppleTvControlLibrary.Discovery.Companion
- Assembly
- AppleTvControlLibrary.Discovery.dll
A discovery implementation that always returns a single, pre-configured device instead of performing an mDNS scan. Useful on hosts where multicast is unavailable or unreliable (see WP7 notes on Mono/embedded hosts), or when the address is already known.
public sealed class StaticCompanionDiscovery : ICompanionDiscovery
- Inheritance
-
StaticCompanionDiscovery
- Implements
- Inherited Members
Remarks
Initializes a new instance of the StaticCompanionDiscovery class.
Constructors
StaticCompanionDiscovery(IPAddress, int, string, string?)
A discovery implementation that always returns a single, pre-configured device instead of performing an mDNS scan. Useful on hosts where multicast is unavailable or unreliable (see WP7 notes on Mono/embedded hosts), or when the address is already known.
public StaticCompanionDiscovery(IPAddress address, int port, string name = "", string? uniqueId = null)
Parameters
addressIPAddressThe known address of the Companion Link device.
portintThe Companion Link port.
namestringAn optional display name for the device.
uniqueIdstringAn optional stable unique identifier for the device.
Remarks
Initializes a new instance of the StaticCompanionDiscovery class.
Methods
ScanAsync(TimeSpan, CancellationToken)
Scans the network for Companion Link devices.
public Task<IReadOnlyList<CompanionDiscoveryResult>> ScanAsync(TimeSpan timeout, CancellationToken cancellationToken = default)
Parameters
timeoutTimeSpanHow long to wait for responses.
cancellationTokenCancellationTokenA token to cancel the scan.
Returns
- Task<IReadOnlyList<CompanionDiscoveryResult>>
The discovered Companion Link devices.