public interface HttpConnection
Modifier and Type | Method and Description |
---|---|
Future<Void> |
close()
Like
close(Handler) but returns a Future of the asynchronous result |
default void |
close(Handler<AsyncResult<Void>> handler)
Close the connection and all the currently active streams.
|
HttpConnection |
closeHandler(Handler<Void> handler)
Set a close handler.
|
HttpConnection |
exceptionHandler(Handler<Throwable> handler)
Set an handler called when a connection error happens
|
default int |
getWindowSize() |
default HttpConnection |
goAway(long errorCode)
Like
goAway(long, int) with a last stream id -1 which means to disallow any new stream creation. |
default HttpConnection |
goAway(long errorCode,
int lastStreamId)
Like
goAway(long, int, Buffer) with no buffer. |
HttpConnection |
goAway(long errorCode,
int lastStreamId,
Buffer debugData)
Send a go away frame to the remote endpoint of the connection.
|
HttpConnection |
goAwayHandler(Handler<GoAway> handler)
Set an handler called when a GOAWAY frame is received.
|
String |
indicatedServerName()
Returns the SNI server name presented during the SSL handshake by the client.
|
boolean |
isSsl() |
SocketAddress |
localAddress() |
X509Certificate[] |
peerCertificateChain()
Deprecated.
instead use
peerCertificates() or sslSession() |
List<Certificate> |
peerCertificates() |
Future<Buffer> |
ping(Buffer data)
Same as
ping(Buffer, Handler) but returns a Future of the asynchronous result |
HttpConnection |
ping(Buffer data,
Handler<AsyncResult<Buffer>> pongHandler)
Send a PING frame to the remote endpoint.
|
HttpConnection |
pingHandler(Handler<Buffer> handler)
Set an handler notified when a PING frame is received from the remote endpoint.
|
SocketAddress |
remoteAddress() |
Http2Settings |
remoteSettings() |
HttpConnection |
remoteSettingsHandler(Handler<Http2Settings> handler)
Set an handler that is called when remote endpoint
Http2Settings are updated. |
Http2Settings |
settings() |
default HttpConnection |
setWindowSize(int windowSize)
Update the current connection wide window size to a new size.
|
default Future<Void> |
shutdown()
Like
shutdown(Handler) but returns a Future of the asynchronous result |
default void |
shutdown(Handler<AsyncResult<Void>> handler)
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all current requests
are processed, otherwise after 30 seconds the connection will be closed.
|
Future<Void> |
shutdown(long timeoutMs)
Like
shutdown(long, Handler) but returns a Future of the asynchronous result |
void |
shutdown(long timeout,
Handler<AsyncResult<Void>> handler)
Like
shutdown(Handler) but with a specific timeout in milliseconds. |
HttpConnection |
shutdownHandler(Handler<Void> handler)
Set an handler called when a GOAWAY frame has been sent or received and all connections are closed.
|
SSLSession |
sslSession() |
Future<Void> |
updateSettings(Http2Settings settings)
Send to the remote endpoint an update of the server settings.
|
HttpConnection |
updateSettings(Http2Settings settings,
Handler<AsyncResult<Void>> completionHandler)
Send to the remote endpoint an update of this endpoint settings
The
completionHandler will be notified when the remote endpoint has acknowledged the settings. |
default int getWindowSize()
-1
for HTTP/1.xdefault HttpConnection setWindowSize(int windowSize)
windowSize
- the new window sizedefault HttpConnection goAway(long errorCode)
goAway(long, int)
with a last stream id -1
which means to disallow any new stream creation.default HttpConnection goAway(long errorCode, int lastStreamId)
goAway(long, int, Buffer)
with no buffer.HttpConnection goAway(long errorCode, int lastStreamId, Buffer debugData)
errorCode
and debugData
lastStreamId
will be closed0
when all the remaining streams are closed this connection will be closed automaticallyerrorCode
- the GOAWAY error codelastStreamId
- the last stream iddebugData
- additional debug data sent to the remote endpointHttpConnection goAwayHandler(Handler<GoAway> handler)
handler
- the handlerHttpConnection shutdownHandler(Handler<Void> handler)
handler
- the handlerdefault void shutdown(Handler<AsyncResult<Void>> handler)
handler
- the handler called when shutdown has completeddefault Future<Void> shutdown()
shutdown(Handler)
but returns a Future
of the asynchronous resultvoid shutdown(long timeout, Handler<AsyncResult<Void>> handler)
shutdown(Handler)
but with a specific timeout
in milliseconds.Future<Void> shutdown(long timeoutMs)
shutdown(long, Handler)
but returns a Future
of the asynchronous resultHttpConnection closeHandler(Handler<Void> handler)
handler
- the handler to be notifiedFuture<Void> close()
close(Handler)
but returns a Future
of the asynchronous resultdefault void close(Handler<AsyncResult<Void>> handler)
handler
- the handler to be completed when the connection is closedHttp2Settings settings()
Future<Void> updateSettings(Http2Settings settings)
settings
- the new settingsHttpConnection updateSettings(Http2Settings settings, Handler<AsyncResult<Void>> completionHandler)
completionHandler
will be notified when the remote endpoint has acknowledged the settings.
This is not implemented for HTTP/1.x.settings
- the new settingscompletionHandler
- the handler notified when the settings have been acknowledged by the remote endpointHttp2Settings remoteSettings()
HttpConnection remoteSettingsHandler(Handler<Http2Settings> handler)
Http2Settings
are updated.
This is not implemented for HTTP/1.x.handler
- the handler for remote endpoint settingsHttpConnection ping(Buffer data, Handler<AsyncResult<Buffer>> pongHandler)
data
- the 8 bytes data of the framepongHandler
- an async result handler notified with pong reply or the failureFuture<Buffer> ping(Buffer data)
ping(Buffer, Handler)
but returns a Future
of the asynchronous resultHttpConnection pingHandler(Handler<Buffer> handler)
handler
- the handler to be called when a PING is receivedHttpConnection exceptionHandler(Handler<Throwable> handler)
handler
- the handlerSocketAddress remoteAddress()
null
(e.g a server bound on a domain socket).
If useProxyProtocol
is set to true
, the address returned will be of the actual connecting client.SocketAddress localAddress()
null
(e.g a server bound on a domain socket)
If useProxyProtocol
is set to true
, the address returned will be of the proxy.boolean isSsl()
HttpConnection
is encrypted via SSL/TLS.SSLSession sslSession()
SSLSession
@Deprecated X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException
peerCertificates()
or sslSession()
sslSession()
to
access that method.SSLPeerUnverifiedException
- SSL peer's identity has not been verified.SSLSession.getPeerCertificateChain()
,
sslSession()
List<Certificate> peerCertificates() throws SSLPeerUnverifiedException
SSLPeerUnverifiedException
- SSL peer's identity has not been verified.SSLSession.getPeerCertificateChain()
,
sslSession()
String indicatedServerName()
Copyright © 2021 Eclipse. All rights reserved.