Class HttpSenderOverHTTP2

    • Method Detail

      • sendContent

        protected void sendContent​(HttpExchange exchange,
                                   HttpContent content,
                                   Callback callback)
        Description copied from class: HttpSender
        Implementations should send the content at the HttpContent cursor position over the wire.

        The HttpContent cursor is advanced by HttpSender at the right time, and if more content needs to be sent, this method is invoked again; subclasses need only to send the content at the HttpContent cursor position.

        This method is invoked one last time when HttpContent.isConsumed() is true and therefore there is no actual content to send. This is done to allow subclasses to write "terminal" bytes (such as the terminal chunk when the transfer encoding is chunked) if their protocol needs to.

        Specified by:
        sendContent in class HttpSender
        Parameters:
        exchange - the exchange to send
        content - the content to send
        callback - the callback to notify