code: protected int getAutoPort(int port) throws BindException {
  		if (System.getProperty("os.name").startsWith("Mac")) {
  			if (port == 80) {
  				port = 8080;
  			}
  			return port;
  		}
  		try {
  			checkOpened(port);
  		}
  		catch (BindException e) {
  			if (port == 80) {
  				checkOpened(8080);
  				port = 8080;
  			}
  			else {
  				throw e;
  			}
  		}
  		return port;
  	}
docs: 智能选择port.
  
  @param port
  @return
  @throws BindException