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


Python WebSocketServerProtocol.connectionLost方法代码示例

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


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

示例1: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
	def connectionLost(self, reason):
		try:
			self.factory.clients.remove(self)
		except ValueError:
			# client doesn't exist, pass
			pass
		WebSocketServerProtocol.connectionLost(self, reason)
开发者ID:JohnTocher,项目名称:cbus,代码行数:9,代码来源:saged.py

示例2: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
    def connectionLost(self, reason):
        WebSocketServerProtocol.connectionLost(self, reason)

        envelopes = handler.unregisterClient(self)
        self.factory.sendEnvelopes(envelopes)

        self.factory.unregister(self)
开发者ID:cmacrander,项目名称:common_boards,代码行数:9,代码来源:server.py

示例3: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
	def connectionLost(self, reason):
		WebSocketServerProtocol.connectionLost(self, reason)
		if self.room:
			self.factory.broadcast(self.room.setOnline(self.name, False), self.room.name, self)
			if self.room.empty():
				self.factory.roomEmpty(self.room.name)
		self.factory.unregister(self)
开发者ID:popoffka,项目名称:ponydraw,代码行数:9,代码来源:server.py

示例4: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
   def connectionLost(self, reason):
      WebSocketServerProtocol.connectionLost(self, reason)

      self.factory.stats.trackOctetsWireIn(self.trafficStats.preopenIncomingOctetsWireLevel + \
                                           self.trafficStats.incomingOctetsWireLevel)

      self.factory.stats.trackOctetsWireOut(self.trafficStats.preopenOutgoingOctetsWireLevel + \
                                            self.trafficStats.outgoingOctetsWireLevel)
开发者ID:WilliamRen,项目名称:AutobahnPython,代码行数:10,代码来源:server.py

示例5: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
	def connectionLost(self, reason):
		WebSocketServerProtocol.connectionLost(self, reason)

		if self.connected:
			self.room.user_disconnect(self.user_session)

		self.connected = False
		self.user_session = None
		self.room = None
开发者ID:jwmcglynn,项目名称:videosync,代码行数:11,代码来源:client_connection.py

示例6: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
    def connectionLost(self, reason):

        """

        Unregister each client (self) as it disconnects.

        """

        WebSocketServerProtocol.connectionLost(self, reason)
        self.factory.unregister(self)
开发者ID:jomido,项目名称:tswss,代码行数:12,代码来源:server.py

示例7: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
    WebSocketServerProtocol.connectionLost(self, reason)
    try:
        del self.factory.posdict[self.peerstr]
    except KeyError:
        pass
    try:
        del self.factory.statedict[self.peerstr]
    except KeyError:
        pass
    self.factory.unregister(self)
开发者ID:limnick,项目名称:helicopter,代码行数:13,代码来源:server.py

示例8: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
	def connectionLost(self, reason):
		global serial_port
		global serial_device
		global serial_baudrate

		if not self.connection_invalid:
			print "Disconnect Message Received"
			if serial_port != None:
				oldserial = serial_port
				serial_port = None
				serial_device = None
				serial_baudrate = None
				self.read_thread.stop()
				self.read_thread.join()
				oldserial.close()
		WebSocketServerProtocol.connectionLost(self, reason)
开发者ID:ArduSat,项目名称:python-websocket-daemon,代码行数:18,代码来源:mywinserver.py

示例9: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
    WebSocketServerProtocol.connectionLost(self, reason)
    self.send_hello = False
开发者ID:Ms2ger,项目名称:presto-testo,代码行数:5,代码来源:echo_tls_server.py

示例10: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
     WebSocketServerProtocol.connectionLost(self, reason)
     self.factory.handle_request_end(self)
开发者ID:abbas123456,项目名称:topchat-server,代码行数:5,代码来源:protocol.py

示例11: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
   '''Override function. 
   '''
   WebSocketServerProtocol.connectionLost(self, reason)
   self.factory.unregister(self)
开发者ID:named-data,项目名称:peets,代码行数:7,代码来源:protocol.py

示例12: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason=None):
     WebSocketServerProtocol.connectionLost(self, reason)
     if self in self.factory.clients:
         self.factory.clients.remove(self)
开发者ID:synopslive,项目名称:sydroid,代码行数:6,代码来源:Networking.py

示例13: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
     WebSocketServerProtocol.connectionLost(self, reason)
     #super(WebSocketProcessOutputterThing, self).connectionLost(self, reason)
     self.factory.unregister(self)
开发者ID:4sp1r3,项目名称:websocket_stdout_example,代码行数:6,代码来源:runner.py

示例14: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
     WebSocketServerProtocol.connectionLost(self, reason)
     self.factory.leave(self.peer)
开发者ID:egbertbouman,项目名称:billy,代码行数:5,代码来源:radio.py

示例15: connectionLost

# 需要导入模块: from autobahn.websocket import WebSocketServerProtocol [as 别名]
# 或者: from autobahn.websocket.WebSocketServerProtocol import connectionLost [as 别名]
 def connectionLost(self, reason):
     WebSocketServerProtocol.connectionLost(self, reason)
     print "Connection lost, reason", reason
开发者ID:stuffmatic,项目名称:snacka,代码行数:5,代码来源:echoserver.py


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