public void Terminate() {
        modState = eModState.Terminating;

        shutdown = true;
        
        if (connected) {
            logOut();
            try {
                send.join(1000);
            } catch (InterruptedException ex) {
            }
            com.close();
        }

        try {
            idle.join(1000);
        } catch (InterruptedException ex) {
        }
        try {
            receive.join(1000);
        } catch (InterruptedException ex) {
        }
        if (send.isAlive() || receive.isAlive() || idle.isAlive()) {
            Log(ComEvent.eType.Warning, "Thread abort timeout", idle.isAlive(), receive.isAlive(), send.isAlive());
        }

        if (com != null) {
            com.close();
        }

        modState = eModState.Terminated;
    }