• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript node-opcua-secure-channel.ErrorCallback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中node-opcua-secure-channel.ErrorCallback的典型用法代码示例。如果您正苦于以下问题:TypeScript ErrorCallback类的具体用法?TypeScript ErrorCallback怎么用?TypeScript ErrorCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ErrorCallback类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: suspend_old_session_publish_engine

 function suspend_old_session_publish_engine(innerCallback: ErrorCallback) {
     if (session.hasBeenClosed()) {
         return innerCallback(new Error("Cannot complete subscription republish due to session termination"));
     }
     debugLog(chalk.bgWhite.red("    => suspend old session publish engine...."));
     session.getPublishEngine().suspend(true);
     innerCallback();
 },
开发者ID:node-opcua,项目名称:node-opcua,代码行数:8,代码来源:reconnection.ts


示例2: start_publishing_as_normal

 function start_publishing_as_normal(innerCallback: ErrorCallback) {
     if (session.hasBeenClosed()) {
         return innerCallback(new Error("Cannot complete subscription republish due to session termination"));
     }
     newSession.getPublishEngine().suspend(false);
     const listenerCountAfter = session.listenerCount("");
     assert(newSession === session);
     debugLog("listenerCountBefore =", listenerCountBefore, "listenerCountAfter = ", listenerCountAfter);
     innerCallback();
 }
开发者ID:node-opcua,项目名称:node-opcua,代码行数:10,代码来源:reconnection.ts


示例3: ask_for_subscription_republish

 function ask_for_subscription_republish(innerCallback: ErrorCallback) {
     if (session.hasBeenClosed()) {
         return innerCallback(new Error("Cannot complete subscription republish due to session termination"));
     }
     //  assert(newSession.getPublishEngine().nbPendingPublishRequests === 0, "we should not be publishing here");
     //      call Republish
     return _ask_for_subscription_republish(newSession, innerCallback);
 },
开发者ID:node-opcua,项目名称:node-opcua,代码行数:8,代码来源:reconnection.ts


示例4: innerCallback

 this.findMethodId(conditionId, methodName, (err: Error | null, _methodId?: NodeId) => {
     if (err) {
         return innerCallback(err);
     }
     if (_methodId) {
         methodId = _methodId;
     }
     innerCallback();
 });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:9,代码来源:client_tools.ts


示例5: innerCallback

 this.createSession((err: Error | null, session?: ClientSession) => {
     if (err) {
         return innerCallback(err);
     }
     if (!session) {
         return innerCallback(new Error("internal error"));
     }
     theSession = session;
     innerCallback();
 });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:10,代码来源:opcua_client_impl.ts


示例6: errorLog

 this.disconnect((err?: Error) => {
     need_disconnect = false;
     if (err) {
         errorLog("OPCUAClientImpl#withClientSession: client disconnect failed ?");
     }
     innerCallback();
 });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:7,代码来源:opcua_client_impl.ts


示例7: callback

            this._internal_create_secure_channel(infiniteConnectionRetry, (err?: Error | null) => {

                if (err) {
                    if (err.message.match("ECONNREFUSED")) {
                       return callback(err);
                    }
                    if (err.message.match("Backoff aborted.")) {
                        return failAndRetry(err!, "cannot create secure channel");
                    }
                    if (true || err!.message.match("BadCertificateInvalid")) {
                        errorLog(" _internal_create_secure_channel err = ", err.message);
                        // the server may have shut down the channel because its certificate
                        // has changed ....
                        // let request the server certificate again ....
                        debugLog(chalk.bgWhite.red("ClientBaseImpl: Server Certificate has changed." +
                          " we need to retrieve server certificate again"));

                        return this.fetchServerCertificate(this.endpointUrl, (err1?: Error | null) => {
                            if (err1) {
                                return failAndRetry(err1, "trying to fetch new server certificate");
                            }
                            this._internal_create_secure_channel(infiniteConnectionRetry, (err3?: Error | null) => {
                                if (err3) {
                                    return failAndRetry(err3, "trying to create new channel with new certificate");
                                }
                                callback();
                            });
                        });

                    }
                    debugLog(chalk.bgWhite.red("ClientBaseImpl: cannot reconnect .."));
                    failAndRetry(err!, "cannot create secure channel");

                } else {

                    /**
                     * notify the observers that the reconnection process has been completed
                     * @event after_reconnection
                     * @param err
                     */
                    this.emit("after_reconnection", err); // send after callback
                    assert(this._secureChannel, "expecting a secureChannel here ");
                    // a new channel has be created and a new connection is established
                    debugLog(chalk.bgWhite.red("ClientBaseImpl:  RECONNECTED                !!!"));
                    return callback();
                }
            });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:47,代码来源:client_base_impl.ts


示例8: debugLog

 client.__createSession_step2(session, (err: Error | null, session1?: ClientSessionImpl) => {
     debugLog(chalk.bgWhite.cyan("    => creating a new session (based on old session data).... Done"));
     if (!err && session1) {
         newSession = session1;
         assert(session === session1, "session should have been recycled");
     }
     innerCallback(err ? err : undefined);
 });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:8,代码来源:reconnection.ts



注:本文中的node-opcua-secure-channel.ErrorCallback类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript node-opcua-server.OPCUAServer类代码示例发布时间:2022-05-25
下一篇:
TypeScript node-opcua-pki.CertificateManager类代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap