Class HttpConnection
java.lang.Object
io.vertx.rxjava3.core.http.HttpConnection
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
- Direct Known Subclasses:
HttpClientConnection
Represents an HTTP connection.
HTTP/1.x connection provides a limited implementation, the following methods are implemented:
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclose()Close immediately (shutdown(0, TimeUnit.SECONDS).closeHandler(Handler<Void> handler) Set a close handler.booleanexceptionHandler(Handler<Throwable> handler) Set an handler called when a connection error happensintgoAway(long errorCode) Deprecated.goAway(long errorCode, int lastStreamId) Deprecated.Deprecated.goAwayHandler(Handler<GoAway> handler) Set an handler called when a frame is received.inthashCode()Returns the SNI server name presented during the SSL handshake by the client.booleanisSsl()localAddress(boolean real) static HttpConnectionSend a frame to the remote endpoint.pingHandler(Handler<Buffer> handler) Set an handler notified when a frame is received from the remote endpoint.remoteAddress(boolean real) remoteSettingsHandler(Handler<HttpSettings> handler) Set an handler that is called when remote endpointHttpSettingsare updated.rxClose()Close immediately (shutdown(0, TimeUnit.SECONDS).Send a frame to the remote endpoint.Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).rxShutdown(long timeout, TimeUnit unit) Callsshutdown()rxShutdown(Duration timeout) Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed.rxUpdateSettings(HttpSettings settings) Send to the remote endpoint an update of this endpoint settingssettings()setWindowSize(int windowSize) Update the current connection wide window size to a new size.shutdown()Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).Callsshutdown()Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed.shutdownHandler(Handler<Void> handler) Set ahandlernotified when the HTTP connection is shutdown: the client or server will close the connection within a certain amount of time.toString()updateSettings(HttpSettings settings) Send to the remote endpoint an update of this endpoint settings
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
HttpConnection
-
HttpConnection
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
protocolVersion
- Returns:
- the version of the protocol of this connection
-
getWindowSize
public int getWindowSize()- Returns:
- the current connection window size or
-1for HTTP/1.x
-
setWindowSize
Update the current connection wide window size to a new size. Increasing this value, gives better performance when several data streams are multiplexed This is not implemented for HTTP/1.x.- Parameters:
windowSize- the new window size- Returns:
- a reference to this, so the API can be used fluently
-
goAway
Deprecated.LikegoAway(long)with a last stream id-1which means to disallow any new stream creation.- Parameters:
errorCode-- Returns:
-
goAway
-
goAway
Deprecated.Send a go away frame to the remote endpoint of the connection.- a frame is sent to the to the remote endpoint with the
errorCodeanddebugData - any stream created after the stream identified by
lastStreamIdwill be closed - for an is different than
0when all the remaining streams are closed this connection will be closed automatically
- Parameters:
errorCode- the error codelastStreamId- the last stream iddebugData- additional debug data sent to the remote endpoint- Returns:
- a reference to this, so the API can be used fluently
- a frame is sent to the to the remote endpoint with the
-
goAwayHandler
Set an handler called when a frame is received. This is not implemented for HTTP/1.x.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
shutdownHandler
Set ahandlernotified when the HTTP connection is shutdown: the client or server will close the connection within a certain amount of time. This gives the opportunity to thehandlerto close the current requests in progress gracefully before the HTTP connection is forcefully closed.- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
shutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).- Returns:
- a future completed when shutdown has completed
-
rxShutdown
Shutdown with a 30 seconds timeout (shutdown(30, TimeUnit.SECONDS)).- Returns:
- a future completed when shutdown has completed
-
shutdown
Callsshutdown()- Parameters:
timeout-unit-- Returns:
-
rxShutdown
Callsshutdown()- Parameters:
timeout-unit-- Returns:
-
closeHandler
Set a close handler. The handler will get notified when the connection is closed.- Parameters:
handler- the handler to be notified- Returns:
- a reference to this, so the API can be used fluently
-
close
Close immediately (shutdown(0, TimeUnit.SECONDS).- Returns:
- a future notified when the client is closed
-
rxClose
Close immediately (shutdown(0, TimeUnit.SECONDS).- Returns:
- a future notified when the client is closed
-
settings
- Returns:
- the latest server settings acknowledged by the remote endpoint - this is not implemented for HTTP/1.x
-
updateSettings
Send to the remote endpoint an update of this endpoint settings ThecompletionHandlerwill be notified when the remote endpoint has acknowledged the settings. This is not implemented for HTTP/1.x.- Parameters:
settings- the new settings- Returns:
- a future completed when the settings have been acknowledged by the remote endpoint
-
rxUpdateSettings
Send to the remote endpoint an update of this endpoint settings ThecompletionHandlerwill be notified when the remote endpoint has acknowledged the settings. This is not implemented for HTTP/1.x.- Parameters:
settings- the new settings- Returns:
- a future completed when the settings have been acknowledged by the remote endpoint
-
remoteSettings
- Returns:
- the current remote endpoint settings for this connection - this is not implemented for HTTP/1.x
-
remoteSettingsHandler
Set an handler that is called when remote endpointHttpSettingsare updated. This is not implemented for HTTP/1.x.- Parameters:
handler- the handler for remote endpoint settings- Returns:
- a reference to this, so the API can be used fluently
-
ping
-
rxPing
-
pingHandler
Set an handler notified when a frame is received from the remote endpoint. This is not implemented for HTTP/1.x.- Parameters:
handler- the handler to be called when a is received- Returns:
- a reference to this, so the API can be used fluently
-
exceptionHandler
Set an handler called when a connection error happens- Parameters:
handler- the handler- Returns:
- a reference to this, so the API can be used fluently
-
remoteAddress
- Returns:
- the remote address for this connection, possibly
null(e.g a server bound on a domain socket). IfuseProxyProtocolis set totrue, the address returned will be of the actual connecting client.
-
remoteAddress
- Parameters:
real-- Returns:
-
localAddress
- Returns:
- the local address for this connection, possibly
null(e.g a server bound on a domain socket) IfuseProxyProtocolis set totrue, the address returned will be of the proxy.
-
localAddress
- Parameters:
real-- Returns:
-
isSsl
public boolean isSsl()- Returns:
- true if this
HttpConnectionis encrypted via SSL/TLS.
-
indicatedServerName
Returns the SNI server name presented during the SSL handshake by the client.- Returns:
- the indicated server name
-
shutdown
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed. Client connection are immediately removed from the pool.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
- HTTP/1.x connection will be closed.
- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- a future completed when shutdown has completed
-
rxShutdown
Initiate a graceful connection shutdown, the connection is taken out of service and closed when all the inflight requests are processed, otherwise after atimeoutthe connection will be closed. Client connection are immediately removed from the pool.- HTTP/2 connections will send a go away frame immediately to signal the other side the connection will close.
- HTTP/1.x connection will be closed.
- Parameters:
timeout- the amount of time after which all resources are forcibly closed- Returns:
- a future completed when shutdown has completed
-
sslSession
- Returns:
- SSLSession associated with the underlying socket. Returns null if connection is not SSL.
-
newInstance
-