How to use the node-opcua-service-discovery.sameAnnouncement function in node-opcua-service-discovery

To help you get started, we’ve selected a few node-opcua-service-discovery examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-server-discovery / source / opcua_discovery_server.ts View on Github external
async function _announcedOnMulticastSubnet(
          conf: MdnsDiscoveryConfiguration,
          announcement: Announcement
        ): Promise {

            let b = ((conf as any).bonjourHolder) as BonjourHolder;
            if (b) {
                if (sameAnnouncement(b.announcement!, announcement)) {
                    debugLog("Configuration ", conf.mdnsServerName, " has not changed !");
                    // nothing to do
                    return;
                } else {
                    debugLog("Configuration ", conf.mdnsServerName, " HAS changed !");
                    debugLog(" Was ", b.announcement!);
                    debugLog(" is  ", announcement);
                }
                await _stop_announcedOnMulticastSubnet(conf);
            }
            b = new BonjourHolder();
            ((conf as any).bonjourHolder) = b;
            await b._announcedOnMulticastSubnet(announcement);
        }