public class Http2ServerConnection extends ConnectionBase implements HttpServerConnection
| Modifier and Type | Field and Description |
|---|---|
protected io.vertx.core.http.impl.VertxHttp2ConnectionHandler |
handler |
protected io.netty.channel.ChannelHandlerContext |
handlerContext |
protected io.netty.util.collection.IntObjectMap<io.vertx.core.http.impl.VertxHttp2Stream> |
streams |
chctx, CLOSED_EXCEPTION, context, vertx, voidPromise| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection
|
io.vertx.core.http.impl.Http2ConnectionBase |
closeHandler(Handler<Void> handler)
Set a close handler.
|
protected void |
concurrencyChanged(long concurrency) |
io.vertx.core.http.impl.Http2ConnectionBase |
exceptionHandler(Handler<Throwable> handler)
Set an handler called when a connection error happens
|
int |
getWindowSize() |
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.
|
void |
handleClosed() |
protected void |
handleIdle()
Called by the Netty handler when the connection becomes idle.
|
protected void |
handleInterestedOpsChanged() |
HttpServerConnection |
handler(Handler<HttpServerRequest> handler) |
HttpServerMetrics |
metrics() |
int |
onDataRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.buffer.ByteBuf data,
int padding,
boolean endOfStream) |
void |
onGoAwayRead(io.netty.channel.ChannelHandlerContext ctx,
int lastStreamId,
long errorCode,
io.netty.buffer.ByteBuf debugData) |
void |
onHeadersRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.handler.codec.http2.Http2Headers headers,
int padding,
boolean endOfStream) |
void |
onHeadersRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.handler.codec.http2.Http2Headers headers,
int streamDependency,
short weight,
boolean exclusive,
int padding,
boolean endOfStream) |
void |
onPingAckRead(io.netty.channel.ChannelHandlerContext ctx,
long data) |
void |
onPingRead(io.netty.channel.ChannelHandlerContext ctx,
long data) |
void |
onPriorityRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
int streamDependency,
short weight,
boolean exclusive) |
void |
onPushPromiseRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
int promisedStreamId,
io.netty.handler.codec.http2.Http2Headers headers,
int padding) |
void |
onRstStreamRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
long errorCode) |
void |
onSettingsAckRead(io.netty.channel.ChannelHandlerContext ctx) |
void |
onSettingsRead(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http2.Http2Settings settings) |
void |
onUnknownFrame(io.netty.channel.ChannelHandlerContext ctx,
byte frameType,
int streamId,
io.netty.handler.codec.http2.Http2Flags flags,
io.netty.buffer.ByteBuf payload) |
void |
onWindowUpdateRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
int windowSizeIncrement) |
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.
|
Http2Settings |
remoteSettings() |
HttpConnection |
remoteSettingsHandler(Handler<Http2Settings> handler)
Set an handler that is called when remote endpoint
Http2Settings are updated. |
Http2Settings |
settings() |
HttpConnection |
setWindowSize(int windowSize)
Update the current connection wide window size to a new size.
|
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 timeout)
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(Handler<Void> handler)
Set an handler called when a GOAWAY frame has been sent or received and all connections are closed.
|
HttpConnection |
updateSettings(Http2Settings settings)
Send to the remote endpoint an update of the server settings.
|
protected void |
updateSettings(io.netty.handler.codec.http2.Http2Settings settingsUpdate,
Handler<AsyncResult<Void>> completionHandler) |
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. |
addFuture, channel, channelFuture, channelHandlerContext, checkContext, close, doPause, doResume, doSetWriteQueueMaxSize, exceptionHandler, fail, flush, flush, getContext, handleException, handleMessage, handler, indicatedServerName, isNotWritable, isSsl, localAddress, metric, metric, peerCertificateChain, remoteAddress, remoteName, reportBytesRead, reportBytesWritten, sendFile, sslSession, supportsFileRegion, toPromise, writeToChannel, writeToChannelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchannel, channelHandlerContextclose, closeHandler, exceptionHandler, getWindowSize, goAway, goAway, goAway, goAwayHandler, indicatedServerName, isSsl, localAddress, peerCertificateChain, ping, pingHandler, remoteAddress, remoteSettings, remoteSettingsHandler, settings, setWindowSize, shutdown, shutdown, shutdownHandler, sslSession, updateSettings, updateSettingsprotected final io.netty.util.collection.IntObjectMap<io.vertx.core.http.impl.VertxHttp2Stream> streams
protected final io.netty.channel.ChannelHandlerContext handlerContext
protected final io.vertx.core.http.impl.VertxHttp2ConnectionHandler handler
public HttpServerConnection handler(Handler<HttpServerRequest> handler)
handler in interface HttpServerConnectionpublic HttpServerMetrics metrics()
metrics in class ConnectionBasepublic void onHeadersRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.handler.codec.http2.Http2Headers headers,
int streamDependency,
short weight,
boolean exclusive,
int padding,
boolean endOfStream)
onHeadersRead in interface io.netty.handler.codec.http2.Http2FrameListenerpublic void onHeadersRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.handler.codec.http2.Http2Headers headers,
int padding,
boolean endOfStream)
onHeadersRead in interface io.netty.handler.codec.http2.Http2FrameListenerpublic void onSettingsRead(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http2.Http2Settings settings)
onSettingsRead in interface io.netty.handler.codec.http2.Http2FrameListenerprotected void updateSettings(io.netty.handler.codec.http2.Http2Settings settingsUpdate,
Handler<AsyncResult<Void>> completionHandler)
public void handleClosed()
handleClosed in class ConnectionBaseprotected void handleInterestedOpsChanged()
handleInterestedOpsChanged in class ConnectionBaseprotected void handleIdle()
ConnectionBasehandleIdle in class ConnectionBasepublic void onPriorityRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
int streamDependency,
short weight,
boolean exclusive)
onPriorityRead in interface io.netty.handler.codec.http2.Http2FrameListenerpublic void onSettingsAckRead(io.netty.channel.ChannelHandlerContext ctx)
onSettingsAckRead in interface io.netty.handler.codec.http2.Http2FrameListenerprotected void concurrencyChanged(long concurrency)
public void onPingRead(io.netty.channel.ChannelHandlerContext ctx,
long data)
throws io.netty.handler.codec.http2.Http2Exception
onPingRead in interface io.netty.handler.codec.http2.Http2FrameListenerio.netty.handler.codec.http2.Http2Exceptionpublic void onPingAckRead(io.netty.channel.ChannelHandlerContext ctx,
long data)
throws io.netty.handler.codec.http2.Http2Exception
onPingAckRead in interface io.netty.handler.codec.http2.Http2FrameListenerio.netty.handler.codec.http2.Http2Exceptionpublic void onPushPromiseRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
int promisedStreamId,
io.netty.handler.codec.http2.Http2Headers headers,
int padding)
throws io.netty.handler.codec.http2.Http2Exception
onPushPromiseRead in interface io.netty.handler.codec.http2.Http2FrameListenerio.netty.handler.codec.http2.Http2Exceptionpublic void onGoAwayRead(io.netty.channel.ChannelHandlerContext ctx,
int lastStreamId,
long errorCode,
io.netty.buffer.ByteBuf debugData)
onGoAwayRead in interface io.netty.handler.codec.http2.Http2FrameListenerpublic void onWindowUpdateRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
int windowSizeIncrement)
onWindowUpdateRead in interface io.netty.handler.codec.http2.Http2FrameListenerpublic void onUnknownFrame(io.netty.channel.ChannelHandlerContext ctx,
byte frameType,
int streamId,
io.netty.handler.codec.http2.Http2Flags flags,
io.netty.buffer.ByteBuf payload)
onUnknownFrame in interface io.netty.handler.codec.http2.Http2FrameListenerpublic void onRstStreamRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
long errorCode)
onRstStreamRead in interface io.netty.handler.codec.http2.Http2FrameListenerpublic int onDataRead(io.netty.channel.ChannelHandlerContext ctx,
int streamId,
io.netty.buffer.ByteBuf data,
int padding,
boolean endOfStream)
onDataRead in interface io.netty.handler.codec.http2.Http2FrameListenerpublic int getWindowSize()
getWindowSize in interface HttpConnection-1 for HTTP/1.xpublic HttpConnection setWindowSize(int windowSize)
HttpConnectionsetWindowSize in interface HttpConnectionwindowSize - the new window sizepublic HttpConnection goAway(long errorCode, int lastStreamId, Buffer debugData)
HttpConnectionerrorCode and debugDatalastStreamId will be closed0 when all the remaining streams are closed this connection will be closed automaticallygoAway in interface HttpConnectionerrorCode - the GOAWAY error codelastStreamId - the last stream iddebugData - additional debug data sent to the remote endpointpublic HttpConnection goAwayHandler(Handler<GoAway> handler)
HttpConnectiongoAwayHandler in interface HttpConnectionhandler - the handlerpublic HttpConnection shutdownHandler(Handler<Void> handler)
HttpConnectionshutdownHandler in interface HttpConnectionhandler - the handlerpublic HttpConnection shutdown(long timeout)
HttpConnectiontimeout is fired.
This is not implemented for HTTP/1.x.shutdown in interface HttpConnectiontimeout - the timeout in millisecondspublic HttpConnection shutdown()
HttpConnectionshutdown in interface HttpConnectionpublic io.vertx.core.http.impl.Http2ConnectionBase closeHandler(Handler<Void> handler)
HttpConnectioncloseHandler in interface HttpConnectioncloseHandler in class ConnectionBasehandler - the handler to be notifiedpublic void close()
ConnectionBaseclose in interface HttpConnectionclose in class ConnectionBasepublic HttpConnection remoteSettingsHandler(Handler<Http2Settings> handler)
HttpConnectionHttp2Settings are updated.
This is not implemented for HTTP/1.x.remoteSettingsHandler in interface HttpConnectionhandler - the handler for remote endpoint settingspublic Http2Settings remoteSettings()
remoteSettings in interface HttpConnectionpublic Http2Settings settings()
settings in interface HttpConnectionpublic HttpConnection updateSettings(Http2Settings settings)
HttpConnectionupdateSettings in interface HttpConnectionsettings - the new settingspublic HttpConnection updateSettings(Http2Settings settings, Handler<AsyncResult<Void>> completionHandler)
HttpConnectioncompletionHandler will be notified when the remote endpoint has acknowledged the settings.
This is not implemented for HTTP/1.x.updateSettings in interface HttpConnectionsettings - the new settingscompletionHandler - the handler notified when the settings have been acknowledged by the remote endpointpublic HttpConnection ping(Buffer data, Handler<AsyncResult<Buffer>> pongHandler)
HttpConnectionping in interface HttpConnectiondata - the 8 bytes data of the framepongHandler - an async result handler notified with pong reply or the failurepublic HttpConnection pingHandler(Handler<Buffer> handler)
HttpConnectionpingHandler in interface HttpConnectionhandler - the handler to be called when a PING is receivedpublic io.vertx.core.http.impl.Http2ConnectionBase exceptionHandler(Handler<Throwable> handler)
HttpConnectionexceptionHandler in interface HttpConnectionexceptionHandler in class ConnectionBasehandler - the handlerCopyright © 2020. All rights reserved.