@Override
    public void run() {
        while (parent.isConnected()) {
            try {
                int i = 0;
                while (!parent.getQueue().isEmpty()) {
                    try {
                        final String message = parent.getQueue().remove();
                        parent.write(message + "\r\n");
                        i++;
                        if (i >= Variables.limit) {
                            break;
                        }
                        if (parent.getQueue().isEmpty()) {
                            break;
                        }
                    } catch (final Exception e) {
                        break;
                    }
                }
                if (Variables.limit != 0) {
                    Thread.sleep(1000 / Variables.limit);
                }
            } catch (final Exception e) {
                break;
            }
        }
    }