@Override
        public void run() {
            try {
                Thread thread = Thread.currentThread();
                while (!stopping && !thread.isInterrupted()) {
                    int bytesRead = readMessage();
                    if (!stopping && !thread.isInterrupted()) {
                        messageProcessor.processMessage(buffer, bytesRead, outputStream);
                    }
                }
            } catch (Throwable e) {
                throw new RuntimeException(e);
            }
        }
A {@link MessageProcessor} that simply echos back the received message to the client.
benchmark-base/src/main/java/org/conscrypt/ServerEndpoint.java