protected synchronized void shutdown(){

      if(input!=null)
         try {input.close();}catch(IOException eio1){}
      if(output!=null)
         try {output.close();}catch(IOException eio2){}
      if(socket!=null)
         try {socket.close();}catch(IOException eio3){}

      input=null;
      output=null;
      socket=null;

      if(shutdownHandler!=null)
         shutdownHandler.process();
   }