I am using the DNSSD API's in a UWP application. When I want to broadcast a DNSSD service using DnssdServiceInstance, it seems that multiple instances are created, even though I call the method only once:
//Service Broadcast
_listener = new StreamSocketListener();
_listener.ConnectionReceived += _listener_ConnectionReceived;
await _listener.BindServiceNameAsync("56788");
_service = new DnssdServiceInstance(Username + "._myapp._tcp.local",
NetworkInformation.GetHostNames().FirstOrDefault(x => x.Type == HostNameType.DomainName && x.RawName.Contains("local")),
UInt16.Parse(_listener.Information.LocalPort));
await _service.RegisterStreamSocketListenerAsync(_listener);
When I use a device watcher on another pc, the watcher finds multiple instances of the above mentioned service and simply continues to name them Username(1), Username(2) etc. Is this a bug or am I missing something?