code: @Override
    public void channelRead0(ChannelHandlerContext context, I request)
        throws Exception {
      if (!accept(request)) {
        context.fireChannelRead(request);
        return;
      }
  
      Envelope envelope = null;
      try {
        envelope = convertRequest(request);
      } catch (RequestConversionException rce) {
        serverLogger.logClientError(rce);
        throw rce;
      }
  
      if (envelope.hasControl() && envelope.getControl().getCancel()) {
        ListenableFuture<?> pending = pendingRequests.remove(envelope.getRequestId());
        if (pending != null) {
          boolean cancelled = pending.cancel(true);
          context.channel().writeAndFlush(Envelope.newBuilder()
              .setRequestId(envelope.getRequestId())
              .setControl(Control.newBuilder().setCancel(cancelled)).build());
        }
        return;
      }
  
      Service service = services.lookupByName(envelope.getService());
      if (service == null) {
        serverLogger.logUnknownService(service);
        logger.warning(String.format(
            "Received request for unknown service %s", envelope.getService()));
        context.channel().writeAndFlush(Envelope.newBuilder()
            .setRequestId(envelope.getRequestId())
            .setControl(Control.newBuilder()
                .setError(String.format("Unknown service %s", envelope.getService())))
            .build());
        return;
      }
  
      ServerMethod<? extends Message, ? extends Message> method =
          service.lookup(envelope.getMethod());
      if (method == null) {
        serverLogger.logUnknownMethod(service, envelope.getMethod());
        logger.warning(String.format(
            "Received request for unknown method %s/%s", envelope.getService(),
            envelope.getMethod()));
        context.channel().writeAndFlush(Envelope.newBuilder()
            .setRequestId(envelope.getRequestId())
            .setControl(Control.newBuilder()
                .setError(
                    String.format("Unknown method %s/%s", envelope.getService(),
                        envelope.getMethod())))
            .build());
        return;
      }
      serverLogger.logMethodCall(service, method);
      invoke(method, envelope.getPayload(), envelope.getRequestId(), context.channel());
    }
docs: {@inheritDoc}