@Override
  public void handlerAdded(ChannelHandlerContext ctx) {
    try {
      // send the connection header to server first
      ctx.writeAndFlush(connectionHeaderWithLength.retainedDuplicate());
    } catch (Exception e) {
      // the exception thrown by handlerAdded will not be passed to the exceptionCaught below
      // because netty will remove a handler if handlerAdded throws an exception.
      exceptionCaught(ctx, e);
    }
  }
Implement logic to deal with the rpc connection header.
@since 2.0.0
hbase-client/src/main/java/org/apache/hadoop/hbase/security/NettyHBaseRpcConnectionHeaderHandler.java