{"action":"closed","issue":{"url":"https://api.github.com/repos/onovotny/Zeroconf/issues/44","repository_url":"https://api.github.com/repos/onovotny/Zeroconf","labels_url":"https://api.github.com/repos/onovotny/Zeroconf/issues/44/labels{/name}","comments_url":"https://api.github.com/repos/onovotny/Zeroconf/issues/44/comments","events_url":"https://api.github.com/repos/onovotny/Zeroconf/issues/44/events","html_url":"https://github.com/onovotny/Zeroconf/issues/44","id":153677183,"number":44,"title":"Explicit UWP support","user":{"login":"queequac","id":1773864,"avatar_url":"https://avatars.githubusercontent.com/u/1773864?v=3","gravatar_id":"","url":"https://api.github.com/users/queequac","html_url":"https://github.com/queequac","followers_url":"https://api.github.com/users/queequac/followers","following_url":"https://api.github.com/users/queequac/following{/other_user}","gists_url":"https://api.github.com/users/queequac/gists{/gist_id}","starred_url":"https://api.github.com/users/queequac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/queequac/subscriptions","organizations_url":"https://api.github.com/users/queequac/orgs","repos_url":"https://api.github.com/users/queequac/repos","events_url":"https://api.github.com/users/queequac/events{/privacy}","received_events_url":"https://api.github.com/users/queequac/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-08T20:54:50Z","updated_at":"2016-06-02T21:14:40Z","closed_at":"2016-06-02T21:14:40Z","body":"Currently Zeroconf.RT is intended to serve as helper library for Windows Phone 8.1, Windows Store apps as well as UWP apps.\r\n\r\nBut it has to be noted that targeting the 8.1 platforms has certain limitations that make Zeroconf quite useless. To be precise, the former RT platform does not allow re-using ports. Whenever some other application did already listen to mDNS messages, Windows threw an exception \"Only one usage of each socket address (protocol/network address/port) is normally permitted.\".\r\nIn this case Zeroconf.RT code falls back to a datagram socket without specified port - this is where the trouble actually begins. When no port is specified, you may join a multicast group, but you won't receive anything. While the output stream has port 5353 (since it is specified separately when getting the stream) and the query will be sent out correctly, you will not receive responses with Zeroconf (but with Wireshark you can see them).\r\n\r\nAs a result I often found no services with Windows Phone 8.1, and one of my apps falls back to UPnP discovery then (because the devices I am searching for can be found with both).\r\nWith Windows 10 this seems to be even more critical. To be honest, I never found any service with Zeroconf anymore, since all my phones and desktops do have port 5353 already in use. As mentioned above, the fallback is quite useless, since I sends out the request but won't receive anything without given port.\r\n\r\nFortunately the UWP platform evolves. Starting with Windows 10 it is possible to set a socket's control option to multicast only (`socket.Control.MulticastOnly = true`). When restricting a socket to multicast, windows no longer prevents the re-use of a port already in use.\r\n\r\nSince this can hardly be integrated into the RT helper library, I created a new one for UWP which does that trick and implements also ListenForAnnouncementsAsync method.\r\n\r\nA pull request with helper library and test application is following. Would be great if this could become part of the official code base and available along with the nuget package. :)"}}
{"actor":{"display_login":"queequac"}}