本文整理汇总了Python中autobahn.websocket.WebSocketServerProtocol.onClose方法的典型用法代码示例。如果您正苦于以下问题:Python WebSocketServerProtocol.onClose方法的具体用法?Python WebSocketServerProtocol.onClose怎么用?Python WebSocketServerProtocol.onClose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类autobahn.websocket.WebSocketServerProtocol
的用法示例。
在下文中一共展示了WebSocketServerProtocol.onClose方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: onClose
# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import onClose [as 别名]
def onClose(self, wasClean, code, reason):
# logline("ONCLOSE: %s" % reason)
WebSocketServerProtocol.onClose(self, wasClean, code, reason)
delkey = None
for key in connections:
if connections[key]['wsh'] == self:
delkey = key
if delkey:
del connections[delkey]
logline("jsdb client %s disconnected." % delkey)
示例2: onClose
# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import onClose [as 别名]
def onClose(self, wasClean, code, reason):
"""Connect closed, cleanup"""
# base logs
WebSocketServerProtocol.onClose(self, wasClean, code, reason)
if self.client is None:
if self.debug:
log.msg("MSP430ServerProtocol.onClose - No Client type")
return
self.client.onClose(wasClean, code, reason)
示例3: onClose
# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import onClose [as 别名]
def onClose(self, wasClean, code, reason):
print 'closed', self.peerstr
WebSocketServerProtocol.onClose(self, wasClean,
code, reason)
self.factory.unregister(self)
示例4: onClose
# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import onClose [as 别名]
def onClose(self, wasClean, code, reason):
print 'close ....'
WebSocketServerProtocol.onClose(self, wasClean, code, reason)
示例5: onClose
# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import onClose [as 别名]
def onClose(self, wasClean, code, reason):
print 'close', reason, code
#if self.player:
# self.player.connects.remove(self)
return WebSocketServerProtocol.onClose(self, wasClean, code, reason)