@Internal public class ClientH2PrefaceHandler extends Object
ProtocolIOSession that implements
client side of the HTTP/2 protocol negotiation handshake always forcing the choice
of HTTP/2.| Constructor and Description |
|---|
ClientH2PrefaceHandler(ProtocolIOSession ioSession,
ClientH2StreamMultiplexerFactory http2StreamHandlerFactory,
boolean strictALPNHandshake,
Callback<Exception> exceptionCallback) |
ClientH2PrefaceHandler(ProtocolIOSession ioSession,
ClientH2StreamMultiplexerFactory http2StreamHandlerFactory,
boolean strictALPNHandshake,
FutureCallback<ProtocolIOSession> resultCallback,
Callback<Exception> exceptionCallback) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this connection gracefully.
|
void |
close(CloseMode closeMode)
Closes this process or endpoint and releases any system resources associated
with it.
|
void |
connected(IOSession session)
Triggered after the given session has been just created.
|
void |
disconnected(IOSession session)
Triggered when the given session has been terminated.
|
void |
exception(IOSession session,
Exception cause)
Triggered when the given session throws a exception.
|
EndpointDetails |
getEndpointDetails()
Returns this connection's endpoint details.
|
SocketAddress |
getLocalAddress()
Returns this connection's local address or
null if it is not bound yet. |
ProtocolVersion |
getProtocolVersion()
Returns this connection's protocol version or
null if unknown. |
SocketAddress |
getRemoteAddress()
Returns this connection's remote address or
null if it is not connected yet or
unconnected. |
Timeout |
getSocketTimeout()
Returns the socket timeout value.
|
SSLSession |
getSSLSession()
Returns this connection's SSL session or
null if TLS has not been activated. |
void |
inputReady(IOSession session,
ByteBuffer src)
Triggered when the given session has input pending.
|
boolean |
isOpen()
Checks if this connection is open.
|
void |
outputReady(IOSession session)
Triggered when the given session is ready for output.
|
void |
setSocketTimeout(Timeout timeout)
Sets the socket timeout value.
|
void |
timeout(IOSession session,
Timeout timeout)
Triggered when the given session has timed out.
|
String |
toString() |
public ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake, Callback<Exception> exceptionCallback)
public ClientH2PrefaceHandler(ProtocolIOSession ioSession, ClientH2StreamMultiplexerFactory http2StreamHandlerFactory, boolean strictALPNHandshake, FutureCallback<ProtocolIOSession> resultCallback, Callback<Exception> exceptionCallback)
public void connected(IOSession session) throws IOException
IOEventHandlersession - the I/O session.IOException - in case of an I/O error.public void outputReady(IOSession session) throws IOException
IOEventHandlersession - the I/O session.IOException - in case of an I/O error.public void inputReady(IOSession session, ByteBuffer src) throws IOException
IOEventHandlersession - the I/O session.IOException - in case of an I/O error.public void timeout(IOSession session, Timeout timeout)
IOEventHandlertimeout in interface IOEventHandlersession - the I/O session.timeout - the timeout.public void exception(IOSession session, Exception cause)
IOEventHandlerexception in interface IOEventHandlersession - the I/O session.public void disconnected(IOSession session)
IOEventHandlerdisconnected in interface IOEventHandlersession - the I/O session.public SSLSession getSSLSession()
HttpConnectionnull if TLS has not been activated.getSSLSession in interface HttpConnectionnull if TLS has not been activated.public EndpointDetails getEndpointDetails()
HttpConnectiongetEndpointDetails in interface HttpConnectionpublic void setSocketTimeout(Timeout timeout)
SocketModalCloseablesetSocketTimeout in interface SocketModalCloseabletimeout - timeout valuepublic Timeout getSocketTimeout()
SocketModalCloseablegetSocketTimeout in interface SocketModalCloseablepublic ProtocolVersion getProtocolVersion()
HttpConnectionnull if unknown.getProtocolVersion in interface HttpConnectionnull if unknown.public SocketAddress getRemoteAddress()
HttpConnectionnull if it is not connected yet or
unconnected.getRemoteAddress in interface HttpConnectionnull if it is not connected yet or
unconnected.public SocketAddress getLocalAddress()
HttpConnectionnull if it is not bound yet.getLocalAddress in interface HttpConnectionnull if it is not bound yet.public boolean isOpen()
HttpConnectionisOpen in interface HttpConnectionpublic void close()
throws IOException
HttpConnectionshutdown instead.close in interface Closeableclose in interface AutoCloseableclose in interface HttpConnectionIOExceptionpublic void close(CloseMode closeMode)
ModalCloseableclose in interface ModalCloseablecloseMode - How to close the receiver.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.