public static boolean close(final Socket socket){
  if (socket != null) {
    try {
      socket.close();
    }
 catch (    IOException ignore) {
      return false;
    }
  }
  return true;
}

public static boolean close ( final Socket socket ) { if ( socket != null ) { try { socket . close ( ) ; } catch ( IOException ignore ) { return false ; } } return true ; }
closes the specified socket silently ignoring any ioexception , guarding against null object references . < p / >
