Code example for ServerSocket

Methods: closeisClosed

0
 
   @Override 
   public void destroy() { 
      Log.d(TAG, "Destroying PairingServer " + PORT);
      try { 
         if ((this.server != null) && (!this.server.isClosed())) {
            Log.i(TAG, "Destroying Socket " + PORT);
            this.server.close();
            this.server = null;
         } 
         this.interrupt();
      } catch (IOException e) {
         Log.w(TAG, e);
      } 
   } 
 
   @Override 
   public void run() { 
      try { 
         // start listening on a specific port for any requests 
Experience pair programming with AI  Get Codota for Java