DnssdServiceInstance DnssdServiceInstance DnssdServiceInstance DnssdServiceInstance DnssdServiceInstance Class

Definition

Encapsulates an instance of a service that uses DNS Service Discovery (DNS-SD).

public : sealed class DnssdServiceInstance : IStringable, IDnssdServiceInstance
struct winrt::Windows::Networking::ServiceDiscovery::Dnssd::DnssdServiceInstance : IStringable, IDnssdServiceInstance
public sealed class DnssdServiceInstance : IStringable, IDnssdServiceInstance
Public NotInheritable Class DnssdServiceInstance Implements IStringable, IDnssdServiceInstance
var dnssdServiceInstance = new dnssdServiceInstance(dnssdServiceInstanceName, hostName, port);
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

Use this class if you are providing a service that advertises itself to other DNS-SD users, or if you are consuming services advertised via DNS-SD.

If your code attempts to register a service instance with the same name as a previously-registered service, your service will be renamed to avoid a conflict by adding a number in parentheses at the end of the name you specified. For example, if you specified "mygame" and that name was already registered for another service, your service would be renamed to something like, "mygame (2)". When this is done, DnssdRegistrationResult.HasInstanceNameChanged is set to true.

Constructors

DnssdServiceInstance(String, HostName, UInt16) DnssdServiceInstance(String, HostName, UInt16) DnssdServiceInstance(String, HostName, UInt16) DnssdServiceInstance(String, HostName, UInt16) DnssdServiceInstance(String, HostName, UInt16)

Creates a new DnssdServiceInstance object with the specified instance name, host name, and port.

Properties

DnssdServiceInstanceName DnssdServiceInstanceName DnssdServiceInstanceName DnssdServiceInstanceName DnssdServiceInstanceName

Gets or sets the DNS-SD service instance name for this DnssdServiceInstance.

HostName HostName HostName HostName HostName

Gets or sets the hostname of the host for this DnssdServiceInstance.

Port Port Port Port Port

Gets or sets the port number used by this DnssdServiceInstance.

Priority Priority Priority Priority Priority

Gets or sets the priority value to assign to this service instance, as defined in RFC 2782. Clients use Priority to decide which of several equivalent service instances to attach to.

TextAttributes TextAttributes TextAttributes TextAttributes TextAttributes

Gets the attributes of this service instance, as a list of [name, value] pairs of strings. Attributes can be inspected by service clients to determine additional information about a service instance.

The specific attribute names and values used by a service are determined by the designer of the service. For example, a service instance for a multiplayer game might have attributes describing which game map the instance is using, or the game difficulty level of the instance. Different service instances would be active for different maps or difficulty levels, and a client using the game service could use the attribute values to determine which game server instance to connect to for the player's preferred map or difficulty level.

Weight Weight Weight Weight Weight

Gets or sets the weight value assigned to this service instance, as defined in RFC 2782. Clients use the Weight value to choose between servers with the same Priority value.

Methods

RegisterDatagramSocketAsync(DatagramSocket) RegisterDatagramSocketAsync(DatagramSocket) RegisterDatagramSocketAsync(DatagramSocket) RegisterDatagramSocketAsync(DatagramSocket) RegisterDatagramSocketAsync(DatagramSocket)

Asynchronously registers a datagram (UDP) socket listener for the service, on a given socket.

RegisterDatagramSocketAsync(DatagramSocket, NetworkAdapter) RegisterDatagramSocketAsync(DatagramSocket, NetworkAdapter) RegisterDatagramSocketAsync(DatagramSocket, NetworkAdapter) RegisterDatagramSocketAsync(DatagramSocket, NetworkAdapter) RegisterDatagramSocketAsync(DatagramSocket, NetworkAdapter)

Asynchronously registers a datagram (UDP) socket listener for the service, on a given socket and network adapter.

RegisterStreamSocketListenerAsync(StreamSocketListener) RegisterStreamSocketListenerAsync(StreamSocketListener) RegisterStreamSocketListenerAsync(StreamSocketListener) RegisterStreamSocketListenerAsync(StreamSocketListener) RegisterStreamSocketListenerAsync(StreamSocketListener)

Asynchronously registers a stream (TCP) socket listener for the service, on the given socket.

RegisterStreamSocketListenerAsync(StreamSocketListener, NetworkAdapter) RegisterStreamSocketListenerAsync(StreamSocketListener, NetworkAdapter) RegisterStreamSocketListenerAsync(StreamSocketListener, NetworkAdapter) RegisterStreamSocketListenerAsync(StreamSocketListener, NetworkAdapter) RegisterStreamSocketListenerAsync(StreamSocketListener, NetworkAdapter)

Asynchronously registers a stream (TCP) socket listener for the service, on the given socket and network adapter.

ToString() ToString() ToString() ToString() ToString()

Gets the DNS Server Resource Record (SRV RR) of this service instance, as a string.

See RFC 1034 for the format and contents of the DNS SRV RR, and RFC 2782 and RFC 6763 for details about how DNS-SD clients and servers use those records.

See Also