本文整理汇总了Python中autobahn.twisted.websocket.WampWebSocketServerFactory.noisy方法的典型用法代码示例。如果您正苦于以下问题:Python WampWebSocketServerFactory.noisy方法的具体用法?Python WampWebSocketServerFactory.noisy怎么用?Python WampWebSocketServerFactory.noisy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autobahn.twisted.websocket.WampWebSocketServerFactory
的用法示例。
在下文中一共展示了WampWebSocketServerFactory.noisy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: start_management_transport
# 需要导入模块: from autobahn.twisted.websocket import WampWebSocketServerFactory [as 别名]
# 或者: from autobahn.twisted.websocket.WampWebSocketServerFactory import noisy [as 别名]
def start_management_transport(self, config, details = None):
"""
Start transport for local management router.
:param config: Transport configuration.
:type config: obj
"""
if self.debug:
log.msg("{}.start_management_transport".format(self.__class__.__name__), config)
if self._management_transport:
emsg = "ERROR: could not start management transport - already running (or starting)"
log.msg(emsg)
raise ApplicationError("crossbar.error.already_started", emsg)
try:
checkconfig.check_listening_transport_websocket(config)
except Exception as e:
emsg = "ERROR: could not start management transport - invalid configuration ({})".format(e)
log.msg(emsg)
raise ApplicationError('crossbar.error.invalid_configuration', emsg)
self._management_transport = ManagementTransport(config, details.authid)
factory = WampWebSocketServerFactory(self._node._router_session_factory, debug = False)
factory.setProtocolOptions(failByDrop = False)
factory.noisy = False
starting_topic = '{}.on_management_transport_starting'.format(self._uri_prefix)
starting_info = self._management_transport.marshal()
## the caller gets a progressive result ..
if details.progress:
details.progress(starting_info)
## .. while all others get an event
self.publish(starting_topic, starting_info, options = PublishOptions(exclude = [details.caller]))
try:
self._management_transport.port = yield create_listening_port_from_config(config['endpoint'], factory, self.cbdir, reactor)
except Exception as e:
self._management_transport = None
emsg = "ERROR: local management service endpoint cannot listen - {}".format(e)
log.msg(emsg)
raise ApplicationError("crossbar.error.cannot_listen", emsg)
## alright, manhole has started
self._management_transport.started = datetime.utcnow()
self._management_transport.status = 'started'
started_topic = '{}.on_management_transport_started'.format(self._uri_prefix)
started_info = self._management_transport.marshal()
self.publish(started_topic, started_info, options = PublishOptions(exclude = [details.caller]))
returnValue(started_info)