- 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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumSupport by this selector. -
Method Summary
Modifier and TypeMethodDescriptionintHow many bytes are needed to identify this connection.Create a new connection.Application protocols supported by this selector, used for example for ALPN negotiation.supports(BufferData data) Does this selector support current server connection.
-
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 toServerConnection.handle(java.util.concurrent.Semaphore)- Parameters:
data- bytes (with available bytes of at leastbytesToIdentifyConnection())- Returns:
- support response
-
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
-