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() |
SocketAddress |
localAddress(boolean real)
|
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() |
SocketAddress |
remoteAddress(boolean real)
|
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)
Shutdown a 30 seconds timeout (
shutdown(30, TimeUnit.SECONDS) ). |
default Future<Void> |
shutdown(long timeoutMs)
Deprecated.
instead use
shutdown(long, TimeUnit) |
default void |
shutdown(long timeout,
Handler<AsyncResult<Void>> handler)
Deprecated.
instead use
shutdown(long, TimeUnit, Handler) |
Future<Void> |
shutdown(long timeout,
TimeUnit unit)
Like
shutdown(long, TimeUnit, Handler) but returns a Future of the asynchronous result |
default void |
shutdown(long timeout,
TimeUnit unit,
Handler<AsyncResult<Void>> handler)
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests
are processed, otherwise after a
timeout the connection will be closed. |
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)
shutdown(30, TimeUnit.SECONDS)
).default Future<Void> shutdown()
shutdown(Handler)
but returns a Future
of the asynchronous result@Deprecated default void shutdown(long timeout, Handler<AsyncResult<Void>> handler)
shutdown(long, TimeUnit, Handler)
shutdown(long, TimeUnit, Handler)
, in milliseconds.@Deprecated default Future<Void> shutdown(long timeoutMs)
shutdown(long, TimeUnit)
shutdown(long, Handler)
but returns a Future
of the asynchronous resultdefault void shutdown(long timeout, TimeUnit unit, Handler<AsyncResult<Void>> handler)
timeout
the connection will be closed. Client connection are immediately removed
from the pool.
timeout
- the amount of time after which all resources are forcibly closedunit
- the of the timeouthandler
- the handler notified with the resultFuture<Void> shutdown(long timeout, TimeUnit unit)
shutdown(long, TimeUnit, 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 remoteAddress(boolean real)
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.SocketAddress localAddress(boolean real)
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 © 2024 Eclipse. All rights reserved.