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 |
ws |
chctx, CLOSED_EXCEPTION, context, vertx, voidPromise| Constructor and Description |
|---|
Http1xServerConnection(VertxInternal vertx,
SSLHelper sslHelper,
HttpServerOptions options,
io.netty.channel.ChannelHandlerContext channel,
ContextInternal context,
String serverOrigin,
HttpServerMetrics metrics) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addFuture(Handler<AsyncResult<Void>> completionHandler,
io.netty.channel.ChannelFuture future) |
void |
close()
Close the connection
|
void |
close(Handler<AsyncResult<Void>> handler)
Close the connection and notifies the
handler |
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() |
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 io.netty.channel.ChannelFuture |
sendFile(RandomAccessFile file,
long offset,
long length) |
Http2Settings |
settings() |
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(Handler<Void> handler)
Set an handler called when a GOAWAY frame has been sent or received and all connections are closed.
|
protected boolean |
supportsFileRegion() |
HttpConnection |
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. |
void |
writeToChannel(Object msg,
io.netty.channel.ChannelPromise promise) |
channel, channelFuture, channelHandlerContext, checkContext, doSetWriteQueueMaxSize, exceptionHandler, fail, flush, flush, getContext, handleIdle, handler, indicatedServerName, isNotWritable, isSsl, localAddress, metric, metric, peerCertificateChain, remoteAddress, remoteName, reportBytesRead, reportBytesWritten, sslSession, toPromise, 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 S extends WebSocketImplBase<S> ws
public Http1xServerConnection(VertxInternal vertx, SSLHelper sslHelper, HttpServerOptions options, io.netty.channel.ChannelHandlerContext channel, 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 writeToChannel(Object msg, io.netty.channel.ChannelPromise promise)
writeToChannel in class ConnectionBasepublic void handleInterestedOpsChanged()
handleInterestedOpsChanged in class ConnectionBaseprotected void handleClosed()
handleClosed in class ConnectionBaseprotected void handleException(Throwable t)
handleException in class ConnectionBaseprotected void addFuture(Handler<AsyncResult<Void>> completionHandler, io.netty.channel.ChannelFuture future)
addFuture in class ConnectionBaseprotected boolean supportsFileRegion()
supportsFileRegion in class ConnectionBaseprotected io.netty.channel.ChannelFuture sendFile(RandomAccessFile file, long offset, long length) throws IOException
sendFile in class ConnectionBaseIOExceptionpublic void close()
ConnectionBaseclose in interface HttpConnectionclose in class ConnectionBasepublic void close(Handler<AsyncResult<Void>> handler)
ConnectionBasehandlerclose 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 HttpConnection shutdown()
HttpConnectionshutdown in interface HttpConnectionpublic HttpConnection shutdown(long timeoutMs)
HttpConnectiontimeout is fired.
This is not implemented for HTTP/1.x.shutdown in interface HttpConnectiontimeoutMs - the timeout in millisecondspublic 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 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 receivedCopyright © 2020. All rights reserved.