Class HTTP2Connection

    • Field Detail

      • LOG

        protected static final Logger LOG
    • Constructor Detail

      • HTTP2Connection

        public HTTP2Connection​(ByteBufferPool byteBufferPool,
                               java.util.concurrent.Executor executor,
                               EndPoint endPoint,
                               Parser parser,
                               ISession session,
                               int bufferSize)
    • Method Detail

      • getSession

        public ISession getSession()
      • getParser

        protected Parser getParser()
      • setInputBuffer

        protected void setInputBuffer​(java.nio.ByteBuffer buffer)
      • onOpen

        public void onOpen()
        Description copied from interface: Connection

        Callback method invoked when this connection is opened.

        Creators of the connection implementation are responsible for calling this method.

        Specified by:
        onOpen in interface Connection
        Overrides:
        onOpen in class AbstractConnection
      • onClose

        public void onClose()
        Description copied from interface: Connection

        Callback method invoked when this connection is closed.

        Creators of the connection implementation are responsible for calling this method.

        Specified by:
        onClose in interface Connection
        Overrides:
        onClose in class AbstractConnection
      • onIdleExpired

        public boolean onIdleExpired()
        Description copied from interface: Connection

        Callback method invoked upon an idle timeout event.

        Implementations of this method may return true to indicate that the idle timeout handling should proceed normally, typically failing the EndPoint and causing it to be closed.

        When false is returned, the handling of the idle timeout event is halted immediately and the EndPoint left in the state it was before the idle timeout event.

        Specified by:
        onIdleExpired in interface Connection
        Overrides:
        onIdleExpired in class AbstractConnection
        Returns:
        true to let the EndPoint handle the idle timeout, false to tell the EndPoint to halt the handling of the idle timeout.
      • offerTask

        protected void offerTask​(java.lang.Runnable task,
                                 boolean dispatch)
      • produce

        protected void produce()
      • dispatch

        protected void dispatch()
      • close

        public void close()
        Description copied from interface: Connection

        Performs a logical close of this connection.

        For simple connections, this may just mean to delegate the close to the associated EndPoint but, for example, SSL connections should write the SSL close message before closing the associated EndPoint.

        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface Connection
        Overrides:
        close in class AbstractConnection
      • onFlushed

        public void onFlushed​(long bytes)
                       throws java.io.IOException
        Description copied from interface: WriteFlusher.Listener

        Invoked when a WriteFlusher flushed bytes in a non-blocking way, as part of a - possibly larger - write.

        This method may be invoked multiple times, for example when writing a large buffer: a first flush of bytes, then the connection became TCP congested, and a subsequent flush of bytes when the connection became writable again.

        This method is never invoked concurrently, but may be invoked by different threads, so implementations may not rely on thread-local variables.

        Implementations may throw an IOException to signal that the write should fail, for example if the implementation enforces a minimum data rate.

        Specified by:
        onFlushed in interface WriteFlusher.Listener
        Parameters:
        bytes - the number of bytes flushed
        Throws:
        java.io.IOException - if the write should fail