Represents an HTTP connection.

HTTP/1.x connection provides an limited implementation, the following methods are implemented:

  • [close](../http/HttpConnection.type.html#close)
  • [closeHandler](../http/HttpConnection.type.html#closeHandler)
  • [exceptionHandler](../http/HttpConnection.type.html#exceptionHandler)

no subtypes hierarchy

Initializer
HttpConnection(HttpConnection unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
closeshared default void close()

Close the connection and all the currently active streams.

An HTTP/2 connection will send a frame before.

closeHandlershared default HttpConnection closeHandler(Anything() handler)

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

Parameters:
  • handler

    the handler to be notified

exceptionHandlershared default HttpConnection exceptionHandler(Anything(Throwable) handler)

Set an handler called when a connection error happens

Parameters:
  • handler

    the handler

getWindowSizeshared default Integer getWindowSize()
goAwayshared default HttpConnection goAway(Integer errorCode)

Like goAway with a last stream id -1 which means to disallow any new stream creation.

goAwayshared default HttpConnection goAway(Integer errorCode, Integer lastStreamId)

Like goAway with no buffer.

goAwayshared default HttpConnection goAway(Integer errorCode, Integer lastStreamId, Buffer debugData)

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

  • a 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 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

    the error code

  • lastStreamId

    the last stream id

  • debugData

    additional debug data sent to the remote endpoint

goAwayHandlershared default HttpConnection goAwayHandler(Anything(GoAway)? handler)

Set an handler called when a frame is received.

This is not implemented for HTTP/1.x.

Parameters:
  • handler

    the handler

indicatedServerNameshared default String indicatedServerName()

Returns the SNI server name presented during the SSL handshake by the client.

isSslshared default Boolean isSsl()
localAddressshared default SocketAddress localAddress()
pingshared default HttpConnection ping(Buffer data, Anything(Throwable|Buffer) pongHandler)

Send a frame to the remote endpoint.

This is not implemented for HTTP/1.x.

Parameters:
  • data

    the 8 bytes data of the frame

  • pongHandler

    an async result handler notified with pong reply or the failure

pingHandlershared default HttpConnection pingHandler(Anything(Buffer)? handler)

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

remoteAddressshared default SocketAddress remoteAddress()
remoteSettingsshared default Http2Settings remoteSettings()
remoteSettingsHandlershared default HttpConnection remoteSettingsHandler(Anything(Http2Settings) handler)

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

This is not implemented for HTTP/1.x.

Parameters:
  • handler

    the handler for remote endpoint settings

setWindowSizeshared default HttpConnection setWindowSize(Integer windowSize)

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

settingsshared default Http2Settings settings()
shutdownshared default 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.

This is not implemented for HTTP/1.x.

shutdownshared default HttpConnection shutdown(Integer 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.

This is not implemented for HTTP/1.x.

Parameters:
  • timeoutMs

    the timeout in milliseconds

shutdownHandlershared default HttpConnection shutdownHandler(Anything()? handler)

Set an handler called when a frame has been sent or received and all connections are closed.

This is not implemented for HTTP/1.x.

Parameters:
  • handler

    the handler

updateSettingsshared default HttpConnection updateSettings(Http2Settings settings)

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

This is not implemented for HTTP/1.x.

Parameters:
  • settings

    the new settings

updateSettingsshared default HttpConnection updateSettings(Http2Settings settings, Anything(Throwable?) 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.

This is not implemented for HTTP/1.x.

Parameters:
  • settings

    the new settings

  • completionHandler

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

Inherited Methods
Methods inherited from: Object
equals