public void run() {
        try {
            // loop until thread is terminated
            while (!isInterrupted() && processMsg(readInt())) ;
        } catch (Exception ex) {
            if (parent().isConnected()) {
                eWrapper().error(ex);
            }
        }
        if (parent().isConnected()) {
            m_parent.close();
        }
    }