当前位置: 首页>>代码示例>>Python>>正文


Python WampWebSocketServerProtocol.connectionLost方法代码示例

本文整理汇总了Python中autobahn.twisted.websocket.WampWebSocketServerProtocol.connectionLost方法的典型用法代码示例。如果您正苦于以下问题:Python WampWebSocketServerProtocol.connectionLost方法的具体用法?Python WampWebSocketServerProtocol.connectionLost怎么用?Python WampWebSocketServerProtocol.connectionLost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在autobahn.twisted.websocket.WampWebSocketServerProtocol的用法示例。


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

示例1: connectionLost

# 需要导入模块: from autobahn.twisted.websocket import WampWebSocketServerProtocol [as 别名]
# 或者: from autobahn.twisted.websocket.WampWebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
    try:
       log.msg("Connection to node controller lost.")
       WampWebSocketServerProtocol.connectionLost(self, reason)
    except:
       pass
    finally:
       ## loosing the connection to the node controller (the pipes) is fatal.
       ## stop the reactor and exit with error
       if reactor.running:
          reactor.addSystemEventTrigger('after', 'shutdown', os._exit, 1)
          reactor.stop()
       else:
          sys.exit(1)
开发者ID:rogererens,项目名称:crossbar,代码行数:16,代码来源:process.py

示例2: connectionLost

# 需要导入模块: from autobahn.twisted.websocket import WampWebSocketServerProtocol [as 别名]
# 或者: from autobahn.twisted.websocket.WampWebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
     try:
         # this log message is unlikely to reach the controller (unless
         # only stdin/stdout pipes were lost, but not stderr)
         log.msg("Connection to node controller lost.")
         WampWebSocketServerProtocol.connectionLost(self, reason)
     except:
         pass
     finally:
         # loosing the connection to the node controller is fatal:
         # stop the reactor and exit with error
         if reactor.running:
             reactor.addSystemEventTrigger('after', 'shutdown', os._exit, 1)
             reactor.stop()
开发者ID:OspreyX,项目名称:crossbar,代码行数:16,代码来源:process.py

示例3: connectionLost

# 需要导入模块: from autobahn.twisted.websocket import WampWebSocketServerProtocol [as 别名]
# 或者: from autobahn.twisted.websocket.WampWebSocketServerProtocol import connectionLost [as 别名]
        def connectionLost(self, reason):
            # the behavior here differs slightly whether we're shutting down orderly
            # or shutting down because of "issues"
            if isinstance(reason.value, ConnectionDone):
                was_clean = True
            else:
                was_clean = False

            try:
                # this log message is unlikely to reach the controller (unless
                # only stdin/stdout pipes were lost, but not stderr)
                if was_clean:
                    log.info("Connection to node controller closed cleanly")
                else:
                    log.warn("Connection to node controller lost: {reason}", reason=reason)

                # give the WAMP transport a change to do it's thing
                WampWebSocketServerProtocol.connectionLost(self, reason)
            except:
                # we're in the process of shutting down .. so ignore ..
                pass
            finally:
                # after the connection to the node controller is gone,
                # the worker is "orphane", and should exit

                # determine process exit code
                if was_clean:
                    exit_code = 0
                else:
                    exit_code = 1

                # exit the whole worker process when the reactor has stopped
                reactor.addSystemEventTrigger('after', 'shutdown', os._exit, exit_code)

                # stop the reactor
                try:
                    reactor.stop()
                except ReactorNotRunning:
                    pass
开发者ID:abhimanyu-siwach,项目名称:crossbar,代码行数:41,代码来源:process.py

示例4: connectionLost

# 需要导入模块: from autobahn.twisted.websocket import WampWebSocketServerProtocol [as 别名]
# 或者: from autobahn.twisted.websocket.WampWebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
     WampWebSocketServerProtocol.connectionLost(self, reason)
     self.factory.connectionLost(reason)
开发者ID:growlercab,项目名称:VTK,代码行数:5,代码来源:wamp.py


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