Represents an HTTP connection.
HTTP/1.x connection provides an limited implementation, the following methods are implemented:Constructor and description |
---|
HttpConnection
(java.lang.Object delegate) |
Type | Name and description | ||
---|---|---|---|
void |
close() Close the connection and all the currently active streams. |
||
HttpConnection |
closeHandler(io.vertx.core.Handler<java.lang.Void> handler) Set a close handler. |
||
HttpConnection |
exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler) Set an handler called when a connection error happens |
||
java.lang.Object |
getDelegate() |
||
int |
getWindowSize() @return
|
||
HttpConnection |
goAway(long errorCode) Like HttpConnection.goAway with a last stream id 2^31-1 . |
||
HttpConnection |
goAway(long errorCode, int lastStreamId) Like HttpConnection.goAway 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(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler) Set an handler called when a frame is received. |
||
HttpConnection |
ping(Buffer data, io.vertx.core.Handler<io.vertx.core.AsyncResult<Buffer>> pongHandler) Send a frame to the remote endpoint. |
||
HttpConnection |
pingHandler(io.vertx.core.Handler<Buffer> handler) Set an handler notified when a frame is received from the remote endpoint. |
||
java.util.Map<java.lang.String, java.lang.Object> |
remoteSettings() @return the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x |
||
HttpConnection |
remoteSettingsHandler(io.vertx.core.Handler<java.util.Map<java.lang.String, java.lang.Object>> handler) Set an handler that is called when remote endpoint | HttpConnection |
setWindowSize(int windowSize) Update the current connection wide window size to a new size. |
java.util.Map<java.lang.String, java.lang.Object> |
settings() @return the latest server settings acknowledged by the remote endpoint - this is not implemented for HTTP/1.x |
||
HttpConnection |
shutdown() Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current active streams are closed or after a time out of 30 seconds. |
||
HttpConnection |
shutdown(long timeoutMs) Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current streams will be closed or the timeout is fired.
|
||
HttpConnection |
shutdownHandler(io.vertx.core.Handler<java.lang.Void> handler) Set an handler called when a frame has been sent or received and all connections are closed. |
||
HttpConnection |
updateSettings(java.util.Map<java.lang.String, java.lang.Object> settings = [:]) Send to the remote endpoint an update of the server settings. |
||
HttpConnection |
updateSettings(java.util.Map<java.lang.String, java.lang.Object> settings = [:], io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.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.
|
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Close the connection and all the currently active streams.
An HTTP/2 connection will send a frame before.Set a close handler. The handler will get notified when the connection is closed.
handler
- the handler to be notifiedSet an handler called when a connection error happens
handler
- the handler
-1
for HTTP/1.x Like HttpConnection.goAway with a last stream id 2^31-1
.
Like HttpConnection.goAway with no buffer.
Send a go away frame to the remote endpoint of the connection.
errorCode
and debugData
lastStreamId
will be closed0
when all the remaining streams are closed this connection will be closed automaticallyerrorCode
- the error codelastStreamId
- the last stream iddebugData
- additional debug data sent to the remote endpointSet an handler called when a frame is received.
This is not implemented for HTTP/1.x.handler
- the handlerSend a frame to the remote endpoint.
This is not implemented for HTTP/1.x.data
- the 8 bytes data of the framepongHandler
- an async result handler notified with pong reply or the failureSet an handler notified when a frame is received from the remote endpoint.
This is not implemented for HTTP/1.x.handler
- the handler to be called when a is received
Set an handler that is called when remote endpoint Http2Settings are updated.
This is not implemented for HTTP/1.x.handler
- the handler for remote endpoint settingsUpdate the current connection wide window size to a new size.
Increasing this value, gives better performance when several data streams are multiplexed This is not implemented for HTTP/1.x.windowSize
- the new window size
Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current active streams are closed or after a time out of 30 seconds.
This is not implemented for HTTP/1.x. Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current streams
will be closed or the timeout
is fired.
timeoutMs
- the timeout in millisecondsSet an handler called when a frame has been sent or received and all connections are closed.
This is not implemented for HTTP/1.x.handler
- the handlerSend to the remote endpoint an update of the server settings.
This is not implemented for HTTP/1.x.settings
- the new settings (see Http2Settings)Send to the remote endpoint an update of this endpoint settings
ThecompletionHandler
will be notified when the remote endpoint has acknowledged the settings.
This is not implemented for HTTP/1.x.
settings
- the new settings (see Http2Settings)completionHandler
- the handler notified when the settings have been acknowledged by the remote endpoint