public void run() {
        String buffer;
        while (this.isActive()) {
            try {
                while ((buffer = in.readLine()) != null) {
                    handleReceivedData(buffer);
                    if (dataQueue.length() > 0) {
                        out.write(dataQueue);
                        out.flush();
                        System.out.print("< " + dataQueue);
                        dataQueue = "";
                    }
                }
            } catch (java.io.IOException e) {
                System.out.println(e.getMessage());
                e.printStackTrace();
            }
        }
    }