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.
      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)
      data - bytes (with available bytes of at least bytesToIdentifyConnection())
      support response
    • supportedApplicationProtocols

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

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