Interface ServerConnectionSelector

All Known Implementing Classes:
Http1ConnectionSelector, Http2ConnectionSelector

public interface ServerConnectionSelector
Connection selector is given a chance to analyze request bytes and decide whether this is a connection it can accept.
  • Method Details

    • bytesToIdentifyConnection

      int bytesToIdentifyConnection()
      How many bytes are needed to identify this connection.
      Returns:
      number of bytes needed, return 0 if this is not a fixed value
    • supports

      Does this selector support current server connection. The same buffer will be sent to ServerConnection.handle(java.util.concurrent.Semaphore)
      Parameters:
      data - bytes (with available bytes of at least bytesToIdentifyConnection())
      Returns:
      support response
    • supportedApplicationProtocols

      Set<String> supportedApplicationProtocols()
      Application protocols supported by this selector, used for example for ALPN negotiation.
      Returns:
      set of supported protocols
    • connection

      Create a new connection. All methods will be invoked from a SINGLE virtual thread.
      Parameters:
      ctx - connection context with access to data writer, data reader and other useful information
      Returns:
      a new server connection