Top Description Fields Constructors Methods
io.vertx.core.http.impl

public Class Http1xServerConnection

extends Http1xConnectionBase<ServerWebSocketImpl>
implements HttpServerConnection
Class Inheritance
All Implemented Interfaces
io.vertx.core.http.impl.HttpServerConnection, io.vertx.core.http.HttpConnection
Imports
io.netty.buffer.Unpooled, io.netty.channel.ChannelHandler, .ChannelHandlerContext, .ChannelPipeline, .ChannelPromise, .EventLoop, io.netty.handler.codec.DecoderResult, io.netty.handler.codec.http.DefaultFullHttpResponse, .DefaultHttpRequest, .EmptyHttpHeaders, .FullHttpRequest, .HttpContent, .DefaultHttpContent, .HttpHeaderNames, .HttpHeaders, .HttpObject, .HttpRequest, .HttpResponseStatus, .LastHttpContent, io.netty.handler.codec.http.websocketx.WebSocketDecoderConfig, .WebSocketFrame, .WebSocketHandshakeException, .WebSocketServerHandshaker, .WebSocketServerHandshakerFactory, .WebSocketVersion, io.netty.util.ReferenceCountUtil, io.vertx.core.AsyncResult, .Future, .Handler, .Promise, .Vertx, io.vertx.core.buffer.Buffer, io.vertx.core.http.HttpServerOptions, .HttpServerRequest, .ServerWebSocket, io.vertx.core.impl.ContextInternal, io.vertx.core.impl.future.PromiseInternal, io.vertx.core.impl.logging.Logger, .LoggerFactory, io.vertx.core.net.NetSocket, io.vertx.core.net.impl.NetSocketImpl, .SslChannelProvider, .VertxHandler, io.vertx.core.spi.metrics.HttpServerMetrics, io.vertx.core.spi.tracing.VertxTracer, io.vertx.core.tracing.TracingPolicy, java.util.function.Supplier

This class is optimised for performance when used on the same event loop. However it can be used safely from other threads.

The internal state is protected using the synchronized keyword. If always used on the same event loop, then we benefit from biased locking which makes the overhead of synchronized near zero.

The connection maintains two fields for tracking requests:

When a request is received, it is also the current response if there is no response in progress, otherwise it is queued and will become the response in progress when the current response in progress ends.

Author
Tim Fox

Field Summary

Modifier and TypeField and Description
private boolean
pack-priv final boolean
private Handler<HttpServerRequest>
private boolean
private static final Logger
pack-priv final HttpServerMetrics<R, W, S>
pack-priv final HttpServerOptions
private boolean
private Handler<HttpServerRequest>
private Http1xServerRequest
private Http1xServerRequest
private final String
private final SslChannelProvider
private final Supplier<ContextInternal>
private final TracingPolicy
private boolean
Inherited from io.vertx.core.http.impl.Http1xConnectionBase:
webSocket

Constructor Summary

AccessConstructor and Description
public
Http1xServerConnection(Supplier<ContextInternal> streamContextSupplier, SslChannelProvider sslChannelProvider, HttpServerOptions options, ChannelHandlerContext chctx, ContextInternal context, String serverOrigin, HttpServerMetrics<R, W, S> metrics)

Method Summary

Modifier and TypeMethod and Description
private WebSocketServerHandshaker
pack-priv void
public void
public void
private void
private void
pack-priv String
protected void
private void
public void
public void
public void
private void
private void
public HttpServerConnection
public HttpServerConnection
public HttpServerMetrics<R, W, S>
public void
public Future<NetSocket>
pack-priv void
private void
private void
private void
pack-priv void
protected boolean
pack-priv TracingPolicy
pack-priv Vertx
pack-priv void
pack-priv void
Inherited from io.vertx.core.http.impl.Http1xConnectionBase:
closecloseHandlerexceptionHandlergoAwaygoAwayHandlerhandleWsFramepingpingpingHandlerremoteSettingsremoteSettingsHandlersettingsshutdownshutdownHandlersizeofupdateSettingsupdateSettings

Field Detail

channelPausedback to summary
private boolean channelPaused
handle100ContinueAutomaticallyback to summary
pack-priv final boolean handle100ContinueAutomatically
invalidRequestHandlerback to summary
private Handler<HttpServerRequest> invalidRequestHandler
keepAliveback to summary
private boolean keepAlive
logback to summary
private static final Logger log

Hides io.vertx.core.net.impl.ConnectionBase.log.

metricsback to summary
pack-priv final HttpServerMetrics<R, W, S> metrics
optionsback to summary
pack-priv final HttpServerOptions options
requestFailedback to summary
private boolean requestFailed
requestHandlerback to summary
private Handler<HttpServerRequest> requestHandler
requestInProgressback to summary
private Http1xServerRequest requestInProgress
responseInProgressback to summary
private Http1xServerRequest responseInProgress
serverOriginback to summary
private final String serverOrigin
sslChannelProviderback to summary
private final SslChannelProvider sslChannelProvider
streamContextSupplierback to summary
private final Supplier<ContextInternal> streamContextSupplier
tracingPolicyback to summary
private final TracingPolicy tracingPolicy
writableback to summary
private boolean writable

Constructor Detail

Http1xServerConnectionback to summary
public Http1xServerConnection(Supplier<ContextInternal> streamContextSupplier, SslChannelProvider sslChannelProvider, HttpServerOptions options, ChannelHandlerContext chctx, ContextInternal context, String serverOrigin, HttpServerMetrics<R, W, S> metrics)

Method Detail

createHandshakerback to summary
private WebSocketServerHandshaker createHandshaker(Http1xServerRequest request) throws WebSocketHandshakeException
createWebSocketback to summary
pack-priv void createWebSocket(Http1xServerRequest request, PromiseInternal<ServerWebSocket> promise)
doPauseback to summary
public void doPause()

Overrides io.vertx.core.net.impl.ConnectionBase.doPause.

Annotations
@Override
doResumeback to summary
public void doResume()

Overrides io.vertx.core.net.impl.ConnectionBase.doResume.

Annotations
@Override
enqueueRequestback to summary
private void enqueueRequest(Http1xServerRequest req)
flushAndCloseback to summary
private void flushAndClose()
getServerOriginback to summary
pack-priv String getServerOrigin()
handleClosedback to summary
protected void handleClosed()

Overrides io.vertx.core.net.impl.ConnectionBase.handleClosed.

handleErrorback to summary
private void handleError(HttpObject obj)
handleExceptionback to summary
public void handleException(Throwable t)

Overrides io.vertx.core.http.impl.Http1xConnectionBase.handleException.

Annotations
@Override
handleInterestedOpsChangedback to summary
public void handleInterestedOpsChanged()

Implements abstract io.vertx.core.net.impl.ConnectionBase.handleInterestedOpsChanged.

Annotations
@Override
handleMessageback to summary
public void handleMessage(Object msg)

Overrides io.vertx.core.net.impl.ConnectionBase.handleMessage.

handleNextback to summary
private void handleNext(Http1xServerRequest next)
handleOtherback to summary
private void handleOther(Object msg)
handlerback to summary
public HttpServerConnection handler(Handler<HttpServerRequest> handler)

Implements io.vertx.core.http.impl.HttpServerConnection.handler.

Annotations
@Override
invalidRequestHandlerback to summary
public HttpServerConnection invalidRequestHandler(Handler<HttpServerRequest> handler)

Implements io.vertx.core.http.impl.HttpServerConnection.invalidRequestHandler.

Annotations
@Override
metricsback to summary
public HttpServerMetrics<R, W, S> metrics()

Implements abstract io.vertx.core.net.impl.ConnectionBase.metrics.

Annotations
@Override
netSocketback to summary
public void netSocket(Handler<AsyncResult<NetSocket>> handler)
netSocketback to summary
public Future<NetSocket> netSocket()
netSocketback to summary
pack-priv void netSocket(Promise<NetSocket> promise)
onContentback to summary
private void onContent(Object msg)
onEndback to summary
private void onEnd()
reportResponseCompleteback to summary
private void reportResponseComplete()
responseCompleteback to summary
pack-priv void responseComplete()
supportsFileRegionback to summary
protected boolean supportsFileRegion()

Overrides io.vertx.core.net.impl.ConnectionBase.supportsFileRegion.

Annotations
@Override
tracingPolicyback to summary
pack-priv TracingPolicy tracingPolicy()
vertxback to summary
pack-priv Vertx vertx()
write100Continueback to summary
pack-priv void write100Continue()
write103EarlyHintsback to summary
pack-priv void write103EarlyHints(HttpHeaders headers, PromiseInternal<Void> promise)