public void processData(byte[] data) {
        Object obj = Utils.deserialize(data);
        if (obj instanceof Protocol) {
            String command = ((Protocol) obj).getCommandName();
            Console.log("[TCP] command " + command + " accepted.");
            switch (command) {
                case INSTANTIATE_UDP_RECEIVER:
                    Settings newSettings = ((InstantiateUDPReceiver) obj).getSettings();
                    setSettings(newSettings);
                    instantiateUDPReceiver();
                    break;
                case INSTANTIATE_UDP_SENDER:
                    instantiateUDPSender();
                    break;
                case PRINT_REPORT:
                    Report report = ((PrintReport) obj).getReport();
                    report.calculateAndPrint();
                    break;
                default:
                    Console.log("Unsupported command.");
                    break;
            }
        }
    }