@Override
    public void run() {
      setStopped(false);
      try {
        while ((!Thread.currentThread().isInterrupted()) && (!isStopped())) {

          Thread.sleep(IDLE_TIMEOUT / 2);

          try {
            if (!isStopped()) {
              send(ISession.KEEPALIVE_MESSAGE, null);
            }
          }
          catch (Exception ex) {
            catchException(this, ex);
          }
        }
      }
      catch (InterruptedException ex) {
        //..break in sleep
      }
      finally {
        //..free resources
      }
    }