Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// },
debugLog("a new OPCUA server has been registered");
const recordId = ++this.recordId;
const serverName = service.name;
service.txt.caps = service.txt.caps || "";
let serverCapabilities = service.txt.caps.split(",").map(x => x.toUpperCase()).sort();
assert(serverCapabilities instanceof Array);
const path = service.txt.path || "";
const discoveryUrl = "opc.tcp://" + service.host + ":" + service.port + path;
this.registeredServers.push(
new discovery_service.ServerOnNetwork({
recordId: recordId,
serverName: serverName,
discoveryUrl: discoveryUrl,
serverCapabilities: serverCapabilities
}));
this.lastUpdateDate = new Date(Date.now());
};
}
this.recordId++;
const recordId = this.recordId;
const serverName = service.name;
service.txt = service.txt || {};
const service_txt = service.txt as any;
service_txt.caps = service_txt.caps || "";
const serverCapabilities = service_txt.caps.split(",").map((x: string) => x.toUpperCase()).sort();
const path = service_txt.path || "";
const discoveryUrl = "opc.tcp://" + service.host + ":" + service.port + path;
this.registeredServers.push(
new ServerOnNetwork({
discoveryUrl,
recordId,
serverCapabilities,
serverName
}));
this.lastUpdateDate = new Date(Date.now());
debugLog("a new OPCUA server has been registered on mDNS", service.name, recordId);
};