本文整理汇总了TypeScript中node-opcua-server.OPCUAServer.resumeEndPoints方法的典型用法代码示例。如果您正苦于以下问题:TypeScript OPCUAServer.resumeEndPoints方法的具体用法?TypeScript OPCUAServer.resumeEndPoints怎么用?TypeScript OPCUAServer.resumeEndPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类node-opcua-server.OPCUAServer
的用法示例。
在下文中一共展示了OPCUAServer.resumeEndPoints方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: simulateCertificateAndPrivateKeyChange
async function simulateCertificateAndPrivateKeyChange(server: OPCUAServer) {
const _server = server as any as OPCUAServerPartial;
// create a new key pair
const { certificate, privateKey } = await produceCertificateAndPrivateKey();
_server.$$privateKeyPEM = toPem(privateKey, "RSA PRIVATE KEY");
_server.$$certificateChain = certificate;
_server.$$certificate = undefined;
await server.suspendEndPoints();
await server.shutdownChannels();
await server.resumeEndPoints();
}
示例2: setTimeout
setTimeout(async () => {
try {
debugLog(chalk.yellow(" onCertificateChange => shutting down channels"));
await server.shutdownChannels();
debugLog(chalk.yellow(" onCertificateChange => channels shut down"));
debugLog(chalk.yellow(" onCertificateChange => resuming end points"));
await server.resumeEndPoints();
debugLog(chalk.yellow(" onCertificateChange => end points resumed"));
debugLog(chalk.yellow("channels have been closed -> client should reconnect "));
} catch (err) {
// tslint:disable:no-console
errorLog("Error in CertificateChanged handler ", err.message);
debugLog("err = ", err);
}
}, 2000);