public void close() {
   stop = true;
   ServerThread st = server;
   if (st != null) {
     st.interrupt();
   }
 }