Giter Site home page Giter Site logo

Comments (3)

sebastianhaberey avatar sebastianhaberey commented on August 25, 2024

Note that apparently on Android, registering a Service gives registration.service.host == null

Yes, Android's NsdManager doesn't set the host on the registered service. It's the same on macOS and iOS. Only Windows API will set the host there AFAIK.

Side note: is there an easy way to get the host before registering, so I can add the ip addresses to addresses before registering a host potentially with no way to contact it?

The host will only be null when registering services. It basically means "localhost". When discovering services, there should always be a valid host name in the service object, even for services that are on the same host.

Any idea why PIXEL is only showing up in scans for the other Android?

So if I understand it correctly, the service on your Android Pixel device doesn't appear in the nsd example apps running on your two Windows machines. But when you run dns-sd on the same machines, it shows up. Right?

First, the Pixel's host name "Android-3.local" doesn't seem to be resolvable in your network. This seems strange, maybe you could investigate that. This could definitely be a problem for the plugin if you have IP lookup enabled. But I had a short look at your code and I don't think you do.

Second, I agree with you that if dns-sd lists the service, the plugin should too. Could you try the following:

Open the example app on your Windows machine with Android Studio. Modify the follwing part in nsd/nsd/example/lib/main.dart:

  MyAppState() {
    enableLogging(LogTopic.calls);
    enableLogging(LogTopic.errors); // add this line
  }

Now start the example app using Android Studio. You should see log messages such as

[MethodChannelNsdPlatform] [2022-11-26 12:30:30.065382] [calls] Callback: onServiceDiscovered {handle: f66df09b-d98f-4dae-82de-ebc5a412b674, service.name: Some Service(1), service.type: _http._tcp}

Now start the PIXEL service on your Android device and see if anything related to the Pixel device comes up. Or anything dodgy such as errors.

BTW is any of your devices Android 13?

from nsd.

sebastianhaberey avatar sebastianhaberey commented on August 25, 2024

P.S.: also, it seems like there's two competing domains in your network: local and lan. If I had to guess, that could have something to do with it. I.e. not all devices are in all the domains, so they cannot all see each other.

from nsd.

sebastianhaberey avatar sebastianhaberey commented on August 25, 2024

Since I cannot reproduce this issue in my environment, I'll close it for now. Feel free to file another issue if the problem should persist.

from nsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.