How to use the node-opcua-service-discovery.MdnsDiscoveryConfiguration 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 / src / register_server_manager.js View on Github external
// the applicationUri from the ApplicationDescription defined in 7.1.
            serverUri: server.serverInfo.applicationUri,

            // The globally unique identifier for the Server product.
            productUri: server.serverInfo.productUri,
            serverNames: [
                {locale: "en", text: server.serverInfo.productName}
            ],
            serverType: server.serverType,
            gatewayServerUri: null,
            discoveryUrls: discoveryUrls,
            semaphoreFilePath: null,
            isOnline: isOnline
        },
        discoveryConfiguration: [
            new discovery_service.MdnsDiscoveryConfiguration({
                mdnsServerName: server.serverInfo.applicationUri,
                serverCapabilities: server.capabilitiesForMDNS
            })
        ]
    });

    return request;
}
github node-opcua / node-opcua / packages / node-opcua-server-discovery / source / opcua_discovery_server.ts View on Github external
private async __internalRegisterServer(
      RegisterServerXResponse: any /* RegisterServer2Response | RegisterServerResponse */,
      rawServer: RegisteredServer,
      discoveryConfigurations?: MdnsDiscoveryConfiguration[]
    ): Promise {

        const server = rawServer as any as RegisteredServerExtended;

        if (!discoveryConfigurations) {
            discoveryConfigurations = [new MdnsDiscoveryConfiguration({
                mdnsServerName: undefined,
                serverCapabilities: ["NA"]
            })];
        }

        function sendError(statusCode: StatusCode): Response {
            debugLog(chalk.red("_on_RegisterServer(2)Request error"), statusCode.toString());
            const response1 = new RegisterServerXResponse({
                responseHeader: { serviceResult: statusCode }
            });
            return response1;
        }

        async function _stop_announcedOnMulticastSubnet(conf: MdnsDiscoveryConfiguration): Promise {
            const b = ((conf as any).bonjourHolder) as BonjourHolder;
            await b._stop_announcedOnMulticastSubnet();