Example #1
0
    def serve(self):
        worker_thread = Thread(target=self.tick)
        worker_thread.daemon = True
        worker_thread.start()

        while True:
            connection, address = self.socket_server.accept()
            connection.settimeout(const.SERVER_CONNECTION_TIMEOUT)
            log(f"Server - {address} connected")

            thread = ClientThread(connection, address, self)
            thread.daemon = True
            self.client_pool.append(thread)
            thread.start()