Beispiel #1
0
	def __init__(self, socket, addr, server):
		self.server=server
		try:
			StreamRequestHandler.__init__(self, socket, addr, server)
		except:
			self.keep_alive = False
			return
Beispiel #2
0
 def __init__(self, *args, **kwargs):
     self._logger = get_logger()
     self._availiable_hosts = {}
     self._peer_socks_lock = threading.Lock()
     self._peer_socket = {}
     self._mqtt_client = mqtt_client()
     StreamRequestHandler.__init__(self, *args, **kwargs)
 def __init__(self, socket, addr, server):
     self.server = server
     StreamRequestHandler.__init__(self, socket, addr, server)
     server_thread = threading.Thread(target=self.connect)
     # Exit the server thread when the main thread terminates
     server_thread.daemon = True
     server_thread.start()
 def __init__(self, sock: socket, addr: str, server: WebsocketServer):
     self.server = server
     self.keep_alive = True
     self.handshake_done = False
     self.valid_client = False
     self.sock = sock
     self.id = -1
     StreamRequestHandler.__init__(self, sock, addr, server)
Beispiel #5
0
    def __init__(self, request: socket, client_address: Tuple,
                 server: BaseServer) -> None:
        """
        Creates a new handler for the given client request
        :param request:        Client socket requesting
        :param client_address: Client address
        :param server:         Server requested
        """

        self.server: BaseServer = server
        self.database: Database = server.database
        StreamRequestHandler.__init__(self, request, client_address, server)
Beispiel #6
0
    def __init__(self, request, client_address, server):
        self.queue = Queue()
        self.data = {}
        self.response = None
        self.logger = logging.getLogger(Server.__name__.lower())

        self.log_messages = {
            self.handle.__name__: {
                MSG_RECEIVE: {
                    SUCCESSFUL_MSG_KEY: SERVER_CLIENT_RECV_SUCC_MSG,
                    UNSUCCESSFUL_MSG_KEY: SERVER_CLIENT_RECV_UNSUCC_MSG
                },
                MSG_SEND: {
                    SUCCESSFUL_MSG_KEY: SERVER_CLIENT_SEND_SUCC_MSG,
                    UNSUCCESSFUL_MSG_KEY: SERVER_CLIENT_SEND_UNSUCC_MSG
                },
            }
        }

        StreamRequestHandler.__init__(self, request, client_address, server)
Beispiel #7
0
 def __init__(self, socket, addr, server):
     self.server = server
     self.handshake_done = False
     self.valid_client = False
     self.keep_alive = True
     StreamRequestHandler.__init__(self, socket, addr, server)
Beispiel #8
0
 def __init__(self, *args, **kwargs):
     """Wrapper for StreamRequestHandler.__init__() to log Connection"""
     StreamRequestHandler.__init__(self, *args, **kwargs)
     print('Connected client {}:{}'.format(*self.client_address))
 def __init__(self, socket, addr, server):
     self.server = server
     StreamRequestHandler.__init__(self, socket, addr, server)  # Socket or request, client addr, server
Beispiel #10
0
 def __init__(self, request, client_address, server):
     StreamRequestHandler.__init__(self, request, client_address, server)
Beispiel #11
0
 def __init__(self, socket, addr, server):
   self.server = server
   self.timeout = 5
   StreamRequestHandler.__init__(self, socket, addr, server)
Beispiel #12
0
 def __init__(self, socket, addr, server):
     self.server = server
     self.message_received_callback = None
     StreamRequestHandler.__init__(self, socket, addr, server)
Beispiel #13
0
 def __init__(self, request, client_address, server, socket_server):
     self.socket_server = socket_server
     self.responder = DispatcherResponder(
         self.socket_server.protocols,
         self.socket_server.avro_proxy_factory)
     StreamRequestHandler.__init__(self, request, client_address, server)
Beispiel #14
0
 def __call__(self, request, client_address, server):
     handler = RequestHandler(self.ip, self.servo)
     StreamRequestHandler.__init__(handler, request, client_address, server)
Beispiel #15
0
 def __init__(self, socket, address, server):
     self.server = server  # to access servers top level functionality
     StreamRequestHandler.__init__(self, socket, address, server)
Beispiel #16
0
 def __init__(self, socket, addr, server):
     self.server = server
     #继承StreamRequestHandler类
     StreamRequestHandler.__init__(self, socket, addr, server)
Beispiel #17
0
 def __init__(self, *kargs):
     StreamRequestHandler.__init__(self, *kargs)