public class Http1xServerConnection extends ConnectionBase implements HttpServerConnection
requestInProgress is the request currently receiving messages, the field is set when
a HttpRequest message is received and unset when LastHttpContent is received. Intermediate
HttpContent messages are processed by the request.responseInProgress is the request for which the response is currently being sent. This field
is set when it is null and the requestInProgress field if set, or when there is a pipelined
request waiting its turn for writing the response| Modifier and Type | Field and Description |
|---|---|
protected S |
webSocket |
chctx, CLOSED_EXCEPTION, context, LOCAL_ADDRESS_OVERRIDE, REMOTE_ADDRESS_OVERRIDE, vertx, voidPromise| Constructor and Description |
|---|
Http1xServerConnection(Supplier<ContextInternal> streamContextSupplier,
SSLHelper sslHelper,
HttpServerOptions options,
io.netty.channel.ChannelHandlerContext chctx,
ContextInternal context,
String serverOrigin,
HttpServerMetrics metrics) |
| Modifier and Type | Method and Description |
|---|---|
Future<Void> |
close()
Close the connection
|
io.vertx.core.http.impl.Http1xConnectionBase |
closeHandler(Handler<Void> handler)
Set a close handler.
|
void |
doPause() |
void |
doResume() |
io.vertx.core.http.impl.Http1xConnectionBase |
exceptionHandler(Handler<Throwable> handler)
Set an handler called when a connection error happens
|
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.
|
protected void |
handleClosed() |
protected void |
handleException(Throwable t) |
void |
handleInterestedOpsChanged() |
void |
handleMessage(Object msg) |
HttpServerConnection |
handler(Handler<HttpServerRequest> handler) |
HttpServerMetrics |
metrics() |
Future<NetSocket> |
netSocket() |
void |
netSocket(Handler<AsyncResult<NetSocket>> handler) |
Future<Buffer> |
ping(Buffer data)
Same as
HttpConnection.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.
|
Http2Settings |
remoteSettings() |
HttpConnection |
remoteSettingsHandler(Handler<Http2Settings> handler)
Set an handler that is called when remote endpoint
Http2Settings are updated. |
protected void |
reportBytesRead(Object msg) |
protected void |
reportsBytesWritten(Object msg) |
Http2Settings |
settings() |
Future<Void> |
shutdown(long timeoutMs)
Like
HttpConnection.shutdown(long, Handler) but returns a Future of the asynchronous result |
void |
shutdown(long timeout,
Handler<AsyncResult<Void>> handler)
Like
HttpConnection.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.
|
protected boolean |
supportsFileRegion() |
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. |
channel, channelFuture, channelHandlerContext, close, closeFuture, doSetWriteQueueMaxSize, exceptionHandler, fail, flush, flush, flushBytesRead, flushBytesWritten, getContext, handleIdle, indicatedServerName, isNotWritable, isSsl, localAddress, metric, metric, peerCertificateChain, remoteAddress, remoteName, reportBytesRead, reportBytesWritten, sendFile, sslSession, writeToChannel, writeToChannel, writeToChannel, writeToChannelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitchannel, channelHandlerContext, getContextclose, close, closeHandler, exceptionHandler, getWindowSize, goAway, goAway, goAway, goAwayHandler, indicatedServerName, isSsl, localAddress, peerCertificateChain, ping, ping, pingHandler, remoteAddress, remoteSettings, remoteSettingsHandler, settings, setWindowSize, shutdown, shutdown, shutdown, shutdown, shutdownHandler, sslSession, updateSettings, updateSettingsprotected S extends WebSocketImplBase<S> webSocket
public Http1xServerConnection(Supplier<ContextInternal> streamContextSupplier, SSLHelper sslHelper, HttpServerOptions options, io.netty.channel.ChannelHandlerContext chctx, ContextInternal context, String serverOrigin, HttpServerMetrics metrics)
public HttpServerConnection handler(Handler<HttpServerRequest> handler)
handler in interface HttpServerConnectionpublic HttpServerMetrics metrics()
metrics in class ConnectionBasepublic void handleMessage(Object msg)
handleMessage in class ConnectionBasepublic void doPause()
doPause in class ConnectionBasepublic void doResume()
doResume in class ConnectionBasepublic void netSocket(Handler<AsyncResult<NetSocket>> handler)
public void handleInterestedOpsChanged()
handleInterestedOpsChanged in class ConnectionBaseprotected void handleClosed()
handleClosed in class ConnectionBaseprotected void handleException(Throwable t)
handleException in class ConnectionBaseprotected boolean supportsFileRegion()
supportsFileRegion in class ConnectionBasepublic Future<Void> close()
ConnectionBaseclose in interface HttpConnectionclose in class ConnectionBasepublic io.vertx.core.http.impl.Http1xConnectionBase closeHandler(Handler<Void> handler)
HttpConnectioncloseHandler in interface HttpConnectioncloseHandler in class ConnectionBasehandler - the handler to be notifiedpublic io.vertx.core.http.impl.Http1xConnectionBase exceptionHandler(Handler<Throwable> handler)
HttpConnectionexceptionHandler in interface HttpConnectionexceptionHandler in class ConnectionBasehandler - the handlerpublic 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 void shutdown(long timeout,
Handler<AsyncResult<Void>> handler)
HttpConnectionHttpConnection.shutdown(Handler) but with a specific timeout in milliseconds.shutdown in interface HttpConnectionpublic Future<Void> shutdown(long timeoutMs)
HttpConnectionHttpConnection.shutdown(long, Handler) but returns a Future of the asynchronous resultshutdown in interface HttpConnectionpublic Http2Settings settings()
settings in interface HttpConnectionpublic Future<Void> 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 Http2Settings remoteSettings()
remoteSettings in interface HttpConnectionpublic 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 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 Future<Buffer> ping(Buffer data)
HttpConnectionHttpConnection.ping(Buffer, Handler) but returns a Future of the asynchronous resultping in interface HttpConnectionprotected void reportsBytesWritten(Object msg)
reportsBytesWritten in class ConnectionBaseprotected void reportBytesRead(Object msg)
reportBytesRead in class ConnectionBaseCopyright © 2021. All rights reserved.