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

pack-priv abstract Class Http1xConnectionBase<S extends WebSocketImplBase<S>>

extends ConnectionBase
implements HttpConnection
Class Inheritance
All Implemented Interfaces
io.vertx.core.http.HttpConnection
Known Direct Subclasses
io.vertx.core.http.impl.Http1xServerConnection, io.vertx.core.http.impl.Http1xClientConnection
Imports
io.netty.buffer.ByteBuf, .Unpooled, io.netty.channel.ChannelHandlerContext, .FileRegion, io.netty.handler.codec.http.FullHttpMessage, .HttpContent, .HttpMessage, .LastHttpContent, io.netty.handler.codec.http.websocketx.BinaryWebSocketFrame, .CloseWebSocketFrame, .ContinuationWebSocketFrame, .PingWebSocketFrame, .PongWebSocketFrame, .TextWebSocketFrame, .WebSocketFrame, io.netty.handler.stream.ChunkedFile, io.vertx.codegen.annotations.Nullable, io.vertx.core.AsyncResult, .Future, .Handler, io.vertx.core.buffer.Buffer, io.vertx.core.http.GoAway, .Http2Settings, .HttpConnection, .WebSocketFrameType, io.vertx.core.http.impl.ws.WebSocketFrameImpl, .WebSocketFrameInternal, io.vertx.core.impl.ContextInternal, io.vertx.core.net.impl.ConnectionBase, java.util.concurrent.TimeUnit

Author
Julien Viet

Field Summary

Modifier and TypeField and Description
protected S
Inherited from io.vertx.core.net.impl.ConnectionBase:
chctxCLOSED_EXCEPTIONcontextLOCAL_ADDRESS_OVERRIDEREMOTE_ADDRESS_OVERRIDEvertxvoidPromise

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Future<Void>
close()

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

Implements io.vertx.core.http.HttpConnection.close.

Like close(Handler) but returns a Future of the asynchronous result

public Http1xConnectionBase<S extends WebSocketImplBase<S>>
closeHandler(Handler<Void>
the handler to be notified
handler
)

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

Implements io.vertx.core.http.HttpConnection.closeHandler.

Set a close handler.

private WebSocketFrameInternal
public Http1xConnectionBase<S extends WebSocketImplBase<S>>
exceptionHandler(Handler<Throwable>
the handler
handler
)

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

Implements io.vertx.core.http.HttpConnection.exceptionHandler.

Set an handler called when a connection error happens

public HttpConnection
goAway(long
the GOAWAY error code
errorCode
,
int
the last stream id
lastStreamId
,
Buffer
additional debug data sent to the remote endpoint
debugData
)

Implements io.vertx.core.http.HttpConnection.goAway.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Send a go away frame to the remote endpoint of the connection.

public HttpConnection
public void
pack-priv void
public HttpConnection
ping(Buffer
the 8 bytes data of the frame
data
,
Handler<AsyncResult<Buffer>>
an async result handler notified with pong reply or the failure
pongHandler
)

Implements io.vertx.core.http.HttpConnection.ping.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Send a PING frame to the remote endpoint.

public Future<Buffer>
ping(Buffer data)

Implements io.vertx.core.http.HttpConnection.ping.

References Deprecated Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

Same as ping(Buffer, Handler) but returns a Future of the asynchronous result

public HttpConnection
public Http2Settings
public HttpConnection
remoteSettingsHandler(Handler<Http2Settings>
the handler for remote endpoint settings
handler
)

Implements io.vertx.core.http.HttpConnection.remoteSettingsHandler.

Set an handler that is called when remote endpoint Http2Settings are updated.

public Http2Settings
public Future<Void>
shutdown(long timeout, TimeUnit unit)

Implements io.vertx.core.http.HttpConnection.shutdown.

Like shutdown(long, TimeUnit, Handler) but returns a Future of the asynchronous result

public HttpConnection
protected long
public Future<Void>
updateSettings(Http2Settings
the new settings
settings
)

Implements io.vertx.core.http.HttpConnection.updateSettings.

Send to the remote endpoint an update of the server settings.

public HttpConnection
updateSettings(Http2Settings
the new settings
settings
,
Handler<AsyncResult<Void>>
the handler notified when the settings have been acknowledged by the remote endpoint
completionHandler
)

Implements io.vertx.core.http.HttpConnection.updateSettings.

Send to the remote endpoint an update of this endpoint settings

The completionHandler will be notified when the remote endpoint has acknowledged the settings.

Inherited from io.vertx.core.net.impl.ConnectionBase:
channelchannelFuturechannelHandlerContextclosecloseFuturedoPausedoResumedoSetWriteQueueMaxSizeexceptionHandlerfailflushflushflushBytesReadflushBytesWrittengetContexthandleClosedhandleEventhandleIdlehandleInterestedOpsChangedhandleMessageindicatedServerNameisNotWritableisSslisTrafficShapedlocalAddresslocalAddressmetricmetricmetricspeerCertificateChainpeerCertificatesremoteAddressremoteAddressremoteNamereportBytesReadreportBytesReadreportBytesWrittenreportsBytesWrittensendFilesslSessionsupportsFileRegionwriteToChannelwriteToChannelwriteToChannelwriteToChannel

Field Detail

webSocketback to summary
protected S webSocket

Constructor Detail

Http1xConnectionBaseback to summary
pack-priv Http1xConnectionBase(ContextInternal context, ChannelHandlerContext chctx)

Method Detail

closeback to summary
public Future<Void> close()

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

Implements io.vertx.core.http.HttpConnection.close.

Doc from io.vertx.core.http.HttpConnection.close.

Like close(Handler) but returns a Future of the asynchronous result

Annotations
@Override
closeHandlerback to summary
public Http1xConnectionBase<S extends WebSocketImplBase<S>> closeHandler(Handler<Void> handler)

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

Implements io.vertx.core.http.HttpConnection.closeHandler.

Doc from io.vertx.core.http.HttpConnection.closeHandler.

Set a close handler. The handler will get notified when the connection is closed.

Parameters
handler:Handler<Void>

the handler to be notified

Returns:Http1xConnectionBase<S extends WebSocketImplBase<S>>

a reference to this, so the API can be used fluently

Annotations
@Override
decodeFrameback to summary
private WebSocketFrameInternal decodeFrame(WebSocketFrame msg)
exceptionHandlerback to summary
public Http1xConnectionBase<S extends WebSocketImplBase<S>> exceptionHandler(Handler<Throwable> handler)

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

Implements io.vertx.core.http.HttpConnection.exceptionHandler.

Doc from io.vertx.core.http.HttpConnection.exceptionHandler.

Set an handler called when a connection error happens

Parameters
handler:Handler<Throwable>

the handler

Returns:Http1xConnectionBase<S extends WebSocketImplBase<S>>

a reference to this, so the API can be used fluently

Annotations
@Override
goAwayback to summary
public HttpConnection goAway(long errorCode, int lastStreamId, Buffer debugData)

Implements io.vertx.core.http.HttpConnection.goAway.

Doc from io.vertx.core.http.HttpConnection.goAway.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Send a go away frame to the remote endpoint of the connection.

  • a GOAWAY frame is sent to the to the remote endpoint with the errorCode and debugData
  • any stream created after the stream identified by lastStreamId will be closed
  • for an errorCode is different than 0 when all the remaining streams are closed this connection will be closed automatically

This is not implemented for HTTP/1.x.

Parameters
errorCode:long

the GOAWAY error code

lastStreamId:int

the last stream id

debugData:Buffer

additional debug data sent to the remote endpoint

Returns:HttpConnection

a reference to this, so the API can be used fluently

Annotations
@Override
goAwayHandlerback to summary
public HttpConnection goAwayHandler(@Nullable Handler<GoAway> handler)
Annotations
@Override
handleExceptionback to summary
public void handleException(Throwable t)

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

Annotations
@Override
handleWsFrameback to summary
pack-priv void handleWsFrame(WebSocketFrame msg)
pingback to summary
public HttpConnection ping(Buffer data, Handler<AsyncResult<Buffer>> pongHandler)

Implements io.vertx.core.http.HttpConnection.ping.

Doc from io.vertx.core.http.HttpConnection.ping.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Send a PING frame to the remote endpoint.

This is not implemented for HTTP/1.x.

Parameters
data:Buffer

the 8 bytes data of the frame

pongHandler:Handler<AsyncResult<Buffer>>

an async result handler notified with pong reply or the failure

Returns:HttpConnection

a reference to this, so the API can be used fluently

Annotations
@Override
pingback to summary
public Future<Buffer> ping(Buffer data)

Implements io.vertx.core.http.HttpConnection.ping.

Doc from io.vertx.core.http.HttpConnection.ping.

References Deprecated

Buffer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Same as ping(Buffer, Handler) but returns a Future of the asynchronous result

Annotations
@Override
pingHandlerback to summary
public HttpConnection pingHandler(@Nullable Handler<Buffer> handler)
Annotations
@Override
remoteSettingsback to summary
public Http2Settings remoteSettings()

Implements io.vertx.core.http.HttpConnection.remoteSettings.

Returns:Http2Settings

Doc from io.vertx.core.http.HttpConnection.remoteSettings.

the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x

Annotations
@Override
remoteSettingsHandlerback to summary
public HttpConnection remoteSettingsHandler(Handler<Http2Settings> handler)

Implements io.vertx.core.http.HttpConnection.remoteSettingsHandler.

Doc from io.vertx.core.http.HttpConnection.remoteSettingsHandler.

Set an handler that is called when remote endpoint Http2Settings are updated.

This is not implemented for HTTP/1.x.

Parameters
handler:Handler<Http2Settings>

the handler for remote endpoint settings

Returns:HttpConnection

a reference to this, so the API can be used fluently

Annotations
@Override
settingsback to summary
public Http2Settings settings()

Implements io.vertx.core.http.HttpConnection.settings.

Returns:Http2Settings

Doc from io.vertx.core.http.HttpConnection.settings.

the latest server settings acknowledged by the remote endpoint - this is not implemented for HTTP/1.x

Annotations
@Override
shutdownback to summary
public Future<Void> shutdown(long timeout, TimeUnit unit)

Implements io.vertx.core.http.HttpConnection.shutdown.

Doc from io.vertx.core.http.HttpConnection.shutdown.

Like shutdown(long, TimeUnit, Handler) but returns a Future of the asynchronous result

Annotations
@Override
shutdownHandlerback to summary
public HttpConnection shutdownHandler(@Nullable Handler<Void> handler)
Annotations
@Override
sizeofback to summary
protected long sizeof(Object obj)

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

Annotations
@Override
updateSettingsback to summary
public Future<Void> updateSettings(Http2Settings settings)

Implements io.vertx.core.http.HttpConnection.updateSettings.

Doc from io.vertx.core.http.HttpConnection.updateSettings.

Send to the remote endpoint an update of the server settings.

This is not implemented for HTTP/1.x.

Parameters
settings:Http2Settings

the new settings

Returns:Future<Void>

a future completed with the result

Annotations
@Override
updateSettingsback to summary
public HttpConnection updateSettings(Http2Settings settings, Handler<AsyncResult<Void>> completionHandler)

Implements io.vertx.core.http.HttpConnection.updateSettings.

Doc from io.vertx.core.http.HttpConnection.updateSettings.

Send to the remote endpoint an update of this endpoint settings

The completionHandler will be notified when the remote endpoint has acknowledged the settings.

This is not implemented for HTTP/1.x.

Parameters
settings:Http2Settings

the new settings

completionHandler:Handler<AsyncResult<Void>>

the handler notified when the settings have been acknowledged by the remote endpoint

Returns:HttpConnection

a reference to this, so the API can be used fluently

Annotations
@Override