Class ClientH2PrefaceHandler
java.lang.Object
org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase
org.apache.hc.core5.http2.impl.nio.ClientH2PrefaceHandler
- All Implemented Interfaces:
Closeable
,AutoCloseable
,HttpConnection
,HttpConnectionEventHandler
,SocketModalCloseable
,ModalCloseable
,IOEventHandler
I/O event handler for events fired by
ProtocolIOSession
that implements
client side of the HTTP/2 protocol negotiation handshake always forcing the choice
of HTTP/2.- Since:
- 5.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientH2StreamMultiplexerFactory
private BufferedData
private final AtomicBoolean
private ByteBuffer
(package private) static final byte[]
private final boolean
Fields inherited from class org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase
ioSession
-
Constructor Summary
ConstructorsConstructorDescriptionClientH2PrefaceHandler
(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake) ClientH2PrefaceHandler
(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake, FutureCallback<ProtocolIOSession> resultCallback) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Triggered after the given session has been just created.private void
void
inputReady
(IOSession session, ByteBuffer src) Triggered when the given session has input pending.void
outputReady
(IOSession session) Triggered when the given session is ready for output.toString()
private void
writeOutPreface
(IOSession session) Methods inherited from class org.apache.hc.core5.http2.impl.nio.PrefaceHandlerBase
close, close, disconnected, exception, getEndpointDetails, getLocalAddress, getProtocolVersion, getRemoteAddress, getSocketTimeout, getSSLSession, isOpen, setSocketTimeout, startProtocol, timeout
-
Field Details
-
PREFACE
static final byte[] PREFACE -
http2StreamHandlerFactory
-
strictALPNHandshake
private final boolean strictALPNHandshake -
initialized
-
preface
-
inBuf
-
-
Constructor Details
-
ClientH2PrefaceHandler
public ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake) -
ClientH2PrefaceHandler
public ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake, FutureCallback<ProtocolIOSession> resultCallback) - Since:
- 5.1
-
-
Method Details
-
initialize
- Throws:
IOException
-
writeOutPreface
- Throws:
IOException
-
connected
Description copied from interface:IOEventHandler
Triggered after the given session has been just created.- Parameters:
session
- the I/O session.- Throws:
IOException
-
outputReady
Description copied from interface:IOEventHandler
Triggered when the given session is ready for output.- Parameters:
session
- the I/O session.- Throws:
IOException
-
inputReady
Description copied from interface:IOEventHandler
Triggered when the given session has input pending.- Parameters:
session
- the I/O session.- Throws:
IOException
-
toString
-