Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
console.log("note: OPCUAClientBase#getEndpointsRequest is deprecated, use OPCUAClientBase#getEndpoints instead");
return this.getEndpoints(options,callback);
};
/**
*
* send a FindServers request to a discovery server
* @method findServers
* @async
* @param callback [Function}
*/
const discovery_service = require("node-opcua-service-discovery");
const FindServersRequest = discovery_service.FindServersRequest;
const FindServersResponse = discovery_service.FindServersResponse;
const FindServersOnNetworkRequest = discovery_service.FindServersOnNetworkRequest;
const FindServersOnNetworkResponse = discovery_service.FindServersOnNetworkResponse;
/**
* @method findServers
* @param options
* @param [options.endpointUrl]
* @param [options.localeIds] Array
* @param [options.serverUris] Array
* @param callback
*/
OPCUAClientBase.prototype.findServers = function (options, callback) {
const self = this;
if (!self._secureChannel) {
setImmediate(function () {
const assert = require("node-opcua-assert").assert;
const path = require("path");
const fs = require("fs");
const url = require("url");
const OPCUABaseServer = require("node-opcua-server").OPCUABaseServer;
const OPCUAServerEndPoint = require("node-opcua-server").OPCUAServerEndPoint;
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const discovery_service = require("node-opcua-service-discovery");
const RegisterServerRequest = discovery_service.RegisterServerRequest;
const RegisterServerResponse = discovery_service.RegisterServerResponse;
const RegisterServer2Request = discovery_service.RegisterServer2Request;
const RegisterServer2Response = discovery_service.RegisterServer2Response;
const FindServersOnNetworkRequest = discovery_service.FindServersOnNetworkRequest;
const FindServersOnNetworkResponse = discovery_service.FindServersOnNetworkResponse;
const endpoints_service = require("node-opcua-service-endpoints");
const ApplicationType = endpoints_service.ApplicationType;
const get_fully_qualified_domain_name = require("node-opcua-hostname").get_fully_qualified_domain_name;
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const doDebug = false;
const _announcedOnMulticastSubnet = require("node-opcua-service-discovery")._announcedOnMulticastSubnet;
const _stop_announcedOnMulticastSubnet = require("node-opcua-service-discovery")._stop_announcedOnMulticastSubnet;
const _announceServerOnMulticastSubnet = require("node-opcua-service-discovery")._announceServerOnMulticastSubnet;
function constructFilename(p) {