/**
  * Logs this client off the network. <br>
  * <br>
  * <strong>Note:</strong> removeUsers should not be true when called from a ShutdownHook, as that
  * will lead to a deadlock. See http://bugs.sun.com/bugdatabase/view_bug.do;?bug_id=6261550 for
  * details.
  *
  * @param removeUsers Set to true to remove users from the user list.
  */
 public void logOff(final boolean removeUsers) {
   messages.sendLogoffMessage();
   chatState.setLoggedOn(false);
   chatState.setLogonCompleted(false);
   networkService.disconnect();
   getTopic().resetTopic();
   if (removeUsers) {
     removeAllUsers();
   }
   me.reset();
 }