Interface ServerConnection

All Known Implementing Classes:
Http1Connection, Http2Connection, WsConnection

public interface ServerConnection
Server connection abstraction, used by any provider to handle a socket connection.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    close(boolean interrupt)
    Close a connection.
    void
    handle(Limit limit)
    Start handling the connection.
    How long is this connection idle.
  • Method Details

    • handle

      void handle(Limit limit) throws InterruptedException
      Start handling the connection. Data is provided through ServerConnectionSelector.connection(io.helidon.webserver.ConnectionContext).
      Parameters:
      limit - that is responsible for maximal concurrent request limit, the connection implementation is responsible for invoking each request within the limit using LimitAlgorithm.tryAcquireOutcome(boolean) or the convenience methods on LimitAlgorithm
      Throws:
      InterruptedException - to interrupt any waiting state and terminate this connection
    • idleTime

      Duration idleTime()
      How long is this connection idle. This is a duration from the last request to now.
      Returns:
      idle duration
    • close

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