futomi / node-dns-sd

The node-dns-sd is a Node.js module which is a pure javascript implementation of mDNS/DNS-SD (Apple Bonjour) browser and packet parser. It allows you to discover IPv4 addresses in the local network specifying a service name such as _http._tcp.local. Besides, it allows you to monitor mDNS/DNS-SD packets.
MIT License
44 stars 11 forks source link

Discovery only operates on the first network interface in the list??? #13

Open tony-gutierrez opened 11 months ago

tony-gutierrez commented 11 months ago
async _sendQueryPacket(buf) {
        for (const netif_address of this._netif_address_list) {
            for (let i = 0; i < 3; i++) {
                this._udp.setMulticastInterface(netif_address);
                await this._wait(100);
                await this._udpSend(buf, this._UDP_PORT, this._MULTICAST_ADDR);
                if (this._is_discovering === true) {
                    break;
                }
                await this._wait(100);
            }

        // THIS LINE ENDS QUERYING AFTER THE FIRST INTERFACE????    
        if (this._is_discovering === true) {
                break;
            }
        }
    }

I am not sure why this behavior is in there? It seems like it would only ever query interface 1.