public static void getResponses() throws IOException {
        responses = new ArrayList<String>();
        try {
            int counter = 0;
            CoordinatorGUI.textArea.append("Waiting for response from nodes..." + "\n" + "\n");
            responseSocket.setSoTimeout(5000);
            while (counter < nodes) {

                Socket connection = responseSocket.accept();// venter inntil noen tar kontakt
                ThreadResponseHandler th = new ThreadResponseHandler(connection);
                th.start();
                counter++;
            }
            int waitTime = 0;
            while (responses.size() < nodes || waitTime >= 30) {
                Thread.sleep(1000);
                waitTime++;
            }
            if (responses.size() == nodes) {
                hasResponse = true;
            }
            if (hasResponse) {
                CoordinatorGUI.textArea.append("Recevied response from every node..." + "\n" + "\n");
            }
        } catch (InterruptedException | IOException e) {
            if (e.getMessage().contains("Accept timed out")) {
                CoordinatorGUI.textArea.append("Timeout has been reached..." + "\n" + "\n");
                timeout = true;
                hasResponse = false;
                if (commit) {
                    CoordinatorGUI.textArea.append("Signaling nodes to rollback..." + "\n" + "\n");
                    String rollback = "rollback";
                    buf = rollback.getBytes();
                    packet = new DatagramPacket(buf, buf.length, group, 4446);
                    socket.send(packet);
                    logError();
                } else {
                    abort();
                }
            } else {
                System.err.println(e);
            }
        }

    }