/** Cleanly shuts down the applicaion. first closes any open ports and cleans up, then exits. */
 public void shutdown() {
   connection.closeConnection();
   // System.exit(1);
 }