def __init__(self):
    self.clients = {}
    self.server = None
    try:
        self.server = ThreadedTCPServer(('0.0.0.0', 5002), ThreadedTCPRequestHandler)
        server_thread = threading.Thread(target=self.server.serve_forever)
        server_thread.daemon = True
        server_thread.start()
    except (KeyboardInterrupt, SystemExit, Exception) as e:
        print(e)
        print('end')
        self.server.shutdown()
        self.server.close()
def __init__(self):
    self.clients = {}
    self.server = None
    try:
        self.server = ThreadedTCPServer(('0.0.0.0', 5002), ThreadedTCPRequestHandler)
        server_thread = threading.Thread(target=self.server.serve_forever)
        server_thread.daemon = True
        server_thread.start()
    except (KeyboardInterrupt, SystemExit, Exception) as e:
        print(e)
        print('end')
        self.server.shutdown()
        self.server.close()