Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const once = require("once");
const delayed = require("delayed");
const endpoints_service = require("node-opcua-service-endpoints");
const GetEndpointsRequest = endpoints_service.GetEndpointsRequest;
const GetEndpointsResponse = endpoints_service.GetEndpointsResponse;
const MessageSecurityMode = require("node-opcua-service-secure-channel").MessageSecurityMode;
const toURI = require("node-opcua-secure-channel").toURI;
const SecurityPolicy = require("node-opcua-secure-channel").SecurityPolicy;
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const doDebug = require("node-opcua-debug").checkDebugFlag(__filename);
const OPCUASecureObject = require("node-opcua-common").OPCUASecureObject;
const ClientSecureChannelLayer = require("node-opcua-secure-channel/src/client/client_secure_channel_layer").ClientSecureChannelLayer;
const ClientSession = require("./client_session").ClientSession;
const defaultConnectionStrategy = {
initialDelay: 1000,
maxDelay: 20*1000,// 20 seconds
maxRetry: -1, // infinite
randomisationFactor: 0.1
};
/**
* @class OPCUAClientBase
* @extends EventEmitter
* @param options
if(!fs.existsSync(filename)) {
throw new Error("Cannot find filename " + filename + " ( __dirname = " + __dirname);
}
}
return filename;
}
const debugLog = require("node-opcua-debug").make_debugLog(__filename);
const StatusCodes = require("node-opcua-status-code").StatusCodes;
const endpoints_service = require("node-opcua-service-endpoints");
const GetEndpointsResponse = endpoints_service.GetEndpointsResponse;
const ApplicationType = endpoints_service.ApplicationType;
const OPCUASecureObject = require("node-opcua-common").OPCUASecureObject;
const discovery_service = require("node-opcua-service-discovery");
const FindServersRequest = discovery_service.FindServersRequest;
const FindServersResponse = discovery_service.FindServersResponse;
const LocalizedText = require("node-opcua-data-model").LocalizedText;
const default_server_info = {
// The globally unique identifier for the application instance. This URI is used as
// ServerUri in Services if the application is a Server.
applicationUri: "urn:NodeOPCUA-Server-default",
// The globally unique identifier for the product.
productUri: "NodeOPCUA-Server",