Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not getting any response for ResolveAsync #108

Open
Raj123456788 opened this issue Aug 6, 2021 · 7 comments
Open

Not getting any response for ResolveAsync #108

Raj123456788 opened this issue Aug 6, 2021 · 7 comments

Comments

@Raj123456788
Copy link

Raj123456788 commented Aug 6, 2021

   I followed the documentation (https://github.com/richardschneider/net-mdns#async-queries) and added below code but if the device does not exists I am not getting any response? am I missing something?          

           var Nameservice = _hostname + "._airplay._tcp.local";        
            var query = new Makaretu.Dns.Message();
            var cancellation = new CancellationTokenSource(2000);
            query.Questions.Add(new Question { Name = Nameservice, Type = DnsType.ANY });
            var response = await mdns.ResolveAsync(query, cancellation.Token);
            if (response != null)
            {
                Debug.WriteLine($"Response received {response}");
            }
@queequac
Copy link

queequac commented Aug 9, 2021

Hi @Raj123456788 , unfortunately I am not really a good help here, since I have no airplay devices and cannot test your query against them. But since you asked first in my unicast-related issue - does that mean you are assuming airplay depends on unicast? Most likely not...

Nevertheless, why are you adding the hostname in front of the _airplay._tcp.local? I guess your hostname does simply not match the actual name of the airplay device.
You should try without that one and the dot, so any airplay device on the local network can respond. Then you can have a look through the results whether the one you are looking for is part of the result set.

@Raj123456788
Copy link
Author

@queequac Thanks for the reply. No I am not assuming airplay to be unicast :) I am adding _airplay._tcp.local because that is how that particular airplay device is advertised. I have already tried without .airplay still the same. I am hitting pause on this due to priorities but will post an answer if I find one. Thanks for the help!

@queequac
Copy link

I was not wondering that you add _airplay._tcp.local, more wondering that you put a well-known hostname in front. 😉

@Raj123456788
Copy link
Author

ohh, that was because I wanted response from that specific hostname if it already exists on the n/w. But the real problem is when it does not exists on the n/w despite of CancellationTokenSource set to 2 secs it never returned anything.

@queequac
Copy link

Is that not expected behavior, that nothing is returned if it does not exist? Or did I get you wrong?

@Raj123456788
Copy link
Author

That was my question to the author. Assuming it is correct behavior: If the hostname becomes active on the network after few mins of the query sent I still receive a response. Doesn't the query has a time out of just 2 secs? So I should never receive a response and Timeout is not working. I have fixed this problem by running a timer for 2secs and ignore the responses after 2 secs but I was wondering if Library handled that.

@twofingerrightclick
Copy link

twofingerrightclick commented Jun 14, 2022

Are you on Windows and using Wifi? There are several open issues citing that the library isn't working with Wifi interfaces, and I am not sure if this just limited to Windows devices, but that is the only devices I have tried it with. Try plugging in via Ethernet and turn off Wifi on your machine. I and several others have observed that we are only able to use the library with ethernet interfaces at the moment. I haven't yet delved into as to why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants