Coder Social home page Coder Social logo

Comments (6)

robreuss avatar robreuss commented on June 16, 2024

I implemented the delegate for didNotResolve on the iOS (browsing) side and got this error after timeout:

["NSNetServicesErrorCode": -72007, "NSNetServicesErrorDomain": 10]

Again, services are seen by the browser as being on local., just won't resolve. Thanks in advance!

from netservice.

Bouke avatar Bouke commented on June 16, 2024

I cannot reproduce. I have published a service on Linux/RPi using the "dns_sd" branch (avahi). Using the iOS Simulator with the code below, it resolves just fine:

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, NetServiceDelegate {

    var window: UIWindow?
    var service: NetService?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        service = NetService(domain: "local", type: "_hap._tcp", name: "Thermostaat")
        service!.delegate = self
        service!.resolve(withTimeout: 5)

        return true
    }

    func netServiceWillResolve(_ sender: NetService) {
        NSLog("Will resolve \(sender)")
    }

    func netServiceDidResolveAddress(_ sender: NetService) {
        NSLog("Did resolve \(sender)")
    }

    func netService(_ sender: NetService, didNotResolve errorDict: [String : NSNumber]) {
        NSLog("Did not resolve \(sender), \(errorDict)")
    }
}

Outputs:

2018-12-10 23:17:57.177481+0100 NetServiceTest[44651:2111090] Will resolve <NSNetService 0x60000041aca0> local _hap._tcp Thermostaat -1
2018-12-10 23:17:57.217197+0100 NetServiceTest[44651:2111090] Did resolve <NSNetService 0x60000041aca0> local _hap._tcp Thermostaat 39031

from netservice.

robreuss avatar robreuss commented on June 16, 2024

Still trying to figure this out. Two questions. Is the specification of the domain above as "local" rather than "local." (with a period suffix) a typo or should I be using "local"? Apart from modifying the hostname to include the local domain (in my case, that makes the hostname "ubuntu.local"), are there any configuration changes on the linux side? Thanks!

from netservice.

robreuss avatar robreuss commented on June 16, 2024

BTW, I'm using "master" not "dns_sd" because the later does not compile - errors about "dns_sd.h" not being found.

from netservice.

robreuss avatar robreuss commented on June 16, 2024

Another data point:

When I run "avahi-browse _vmc._tcp. --resolve --verbose" from my raspberry to my ubuntu VM (running bridged networking) I also get a failure to resolve, with this error information (which isn't very helpful):

Server version: avahi 0.6.32-rc; Host name: ubuntu.local
E Ifce Prot Name                                          Type                 Domain
+  ens33 IPv4 Virtual Mobile Controller                     _vmc._tcp            local
Failed to resolve service 'Virtual Mobile Controller' of type '_vmc._tcp' in domain 'local': Timeout reached
: All for now
: Cache exhausted

In contrast, the command does resolve when going from Ubuntu to macOS (which is running Apple's NetService).

from netservice.

robreuss avatar robreuss commented on June 16, 2024

iOS client is now resolving thanks to switching to "dns_sd" branch.

from netservice.

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.