code: private Channel bindToPrivilegedPort() throws RpcException {
          System.out.println("Attempting to use privileged port.");
          for (int port = 1023; port > 0; --port) {
              try {
                  ChannelPipeline pipeline = _clientBootstrap.getPipelineFactory().getPipeline();
                  Channel channel = _clientBootstrap.getFactory().newChannel(pipeline);
                  channel.getConfig().setOptions(_clientBootstrap.getOptions());
                  ChannelFuture bindFuture = channel.bind(new InetSocketAddress(port)).awaitUninterruptibly();
                  if (bindFuture.isSuccess()) {
                      System.out.println("Success! Bound to port " + port);
                      return bindFuture.getChannel();
                  }
              } catch (Exception e) {
                  String msg = String.format("rpc request bind error for address: %s", 
                          getRemoteAddress());
                  throw new RpcException(RpcStatus.NETWORK_ERROR, msg, e);
              }
          }
  
          throw new RpcException(RpcStatus.LOCAL_BINDING_ERROR, String.format("Cannot bind a port < 1024: %s", getRemoteAddress()));
      }
docs: This attempts to bind to privileged ports, starting with 1023 and working downwards, and returns when the first binding succeeds.
  
  <p>
  Some NFS servers apparently may require that some requests originate on
  an Internet port below IPPORT_RESERVED (1024). This is generally not
  used, though, as the client then has to run as a user authorized for
  privileged, which is dangerous. It is also not generally needed.
  </p>
  
  @return
  <ul>
  <li><code>true</code> if the binding succeeds,</li>
  <li><code>false</code> otherwise.</li>
  </ul>
  @throws RpcException If an exception occurs, or if no binding succeeds.