Class Http2Connection

All Implemented Interfaces:
InterruptableTask<Void>, ServerConnection, Runnable, Callable<Void>

public class Http2Connection extends Object implements ServerConnection, InterruptableTask<Void>
HTTP/2 server connection. A single connection is created between a client and a server. A single connection serves multiple streams.
  • Method Details

    • handle

      public void handle(Semaphore requestSemaphore) throws InterruptedException
      Description copied from interface: ServerConnection
      Start handling the connection. Data is provided through ServerConnectionSelector.connection(io.helidon.webserver.ConnectionContext).
      Specified by:
      handle in interface ServerConnection
      requestSemaphore - semaphore that is responsible for maximal concurrent request limit, the connection implementation is responsible for acquiring a permit from the semaphore for the duration of a request, and releasing it when the request ends; please be very careful, as this may lead to complete stop of the server if incorrectly implemented
      InterruptedException - to interrupt any waiting state and terminate this connection
    • clientSettings

      public void clientSettings(Http2Settings http2Settings)
      Client settings, obtained from SETTINGS frame or HTTP/2 upgrade request.
      http2Settings - client settings to use
    • upgradeConnectionData

      public void upgradeConnectionData(HttpPrologue prologue, Http2Headers headers)
      Connection headers from an upgrade request from HTTP/1.1.
      prologue - prologue of the HTTP/2 request
      headers - headers to use for first stream (obtained from original HTTP/1.1 request)
    • expectPreface

      public void expectPreface()
      Expect connection preface (prior knowledge).
    • canInterrupt

      public boolean canInterrupt()
      Description copied from interface: InterruptableTask
      Signals if a task can be interrupted at the time this method is called.
      Specified by:
      canInterrupt in interface InterruptableTask<Void>
      outcome of interruptable test
    • toString

      public String toString()
      toString in class Object
    • idleTime

      public Duration idleTime()
      Description copied from interface: ServerConnection
      How long is this connection idle. This is a duration from the last request to now.
      Specified by:
      idleTime in interface ServerConnection
      idle duration
    • close

      public void close(boolean interrupt)
      Description copied from interface: ServerConnection
      Close a connection. This may be called during shutdown of the server, or when idle timeout is reached.
      Specified by:
      close in interface ServerConnection
      interrupt - whether to interrupt in progress requests (always interrupts idle requests waiting for initial request data)