Example #1
0
 def __init__(self):
     WebSocketServerProtocol.__init__(self)
     
     self.waitingStage = 0
     self.remoteAddr, self.remotePort = '', -1
     self.localAddr , self.localPort  = '', -1
     
     self.connectionClosed = False 
Example #2
0
	def __init__(self, app, **args):
		''''''
		
		dummy = lambda: None
		
		Context.__init__(self, app, {}, dummy, **args)
		WebSocketServerProtocol.__init__(self)
		
		self.messages = []
    def onMessageBegin(self, isBinary):
        self.logger.debug("got new wsmessage from client")
        WebSocketServerProtocol.onMessageBegin(self, isBinary)
        # do one-time and pre-wsmesssage setup
        if (self.wsmsg_count is None): self.__init__()
        self.wsmsg_count += 1
        if(self.msg_state != ServerMsgState.GETTING):
            self.msg_state = ServerMsgState.NEW

        # TODO: verify that isBinary

        # set up a message back to the client for our responses
        self.beginMessage(True)
Example #4
0
	def onClose(self, wasClean, code, reason):
		#print('client closed', code, reason)
		
		# inbuilt by autobahn
		#self.factory = None
		
		
		nabar_id = self.nabar.id
		if nabar_id in IN.APP.contexts:
			try:
				IN.APP.contexts[nabar_id].remove(self)
			except Exception as e:
				pass
		
		WebSocketServerProtocol.onClose(self, wasClean, code, reason)
		
		IN.APP.context_pool.free(self)
Example #5
0
 def onCloseHandshakeTimeout(self):
     logging.warning("Close-Handshake Timeout!")
     WebSocketServerProtocol.onCloseHandshakeTimeout(self)
     return
Example #6
0
 def onOpenHandshakeTimeout(self):
     logging.warning(
         "Open-Handshake Timeout! \033[0;33m(Connection will be closed)")
     WebSocketServerProtocol.onOpenHandshakeTimeout(self)
     return
Example #7
0
 def __init__(self):
     WebSocketServerProtocol.__init__(self)
     self.connected = False
Example #8
0
 def __init__(self):
     WebSocketServerProtocol.__init__(self)
     self.cameras_streaming = {}
     self.terminated = False
Example #9
0
 def connectionLost(self, reason):
     WebSocketServerProtocol.connectionLost(self, reason)
     self.factory.unregister(self)
Example #10
0
 def onMessageFrameBegin(self, length):
     WebSocketServerProtocol.onMessageFrameBegin(self, length)
     self.beginMessageFrame(length)
Example #11
0
 def onMessageBegin(self, isBinary):
     WebSocketServerProtocol.onMessageBegin(self, isBinary)
     self.beginMessage(isBinary)
Example #12
0
 def onClose(self, wasClean, code, reason):
     print("Websocket connection closed: " + str(reason))
     WebSocketServerProtocol.onClose(self, wasClean, code, reason)
     self.factory.unregister(self)
Example #13
0
 def connectionLost(self, reason):
     WebSocketServerProtocol.connectionLost(self, reason)
     self.factory.unregister(self)
Example #14
0
 def onOpenHandshakeTimeout(self):
     logging.error("Open-Handshake Timeout!")
     WebSocketServerProtocol.onOpenHandshakeTimeout(self)
 def onMessageBegin(self, isBinary):
     WebSocketServerProtocol.onMessageBegin(self, isBinary)
     self.beginMessage(isBinary)
 def onMessageFrameBegin(self, length):
     WebSocketServerProtocol.onMessageFrameBegin(self, length)
Example #17
0
 def onClose(self, *args, **kwargs):
     WebSocketServerProtocol.onClose(self, *args, **kwargs)
     self.factory.unregister(self)
Example #18
0
 def connectionLost(self, reason):
     """Unregister on connection drop"""
     WebSocketServerProtocol.connectionLost(self, reason)
     self.factory.unregister(self)
Example #19
0
 def __init__(self):
     WebSocketServerProtocol.__init__(self)
     self.obj_uuid = uuid.uuid4()