interface HttpConnection
Represents an HTTP connection. HTTP/1.x connection provides an limited implementation, the following methods are implemented:
Author
Julien Viet
abstract fun close(): Unit
Close the connection and all the currently active streams. An HTTP/2 connection will send a GOAWAY frame before. |
|
abstract fun closeHandler(handler: Handler<Void>): HttpConnection
Set a close handler. The handler will get notified when the connection is closed. |
|
abstract fun exceptionHandler(handler: Handler<Throwable>): HttpConnection
Set an handler called when a connection error happens |
|
open fun getWindowSize(): Int |
|
open fun goAway(errorCode: Long): HttpConnection
Like open fun goAway(errorCode: Long, lastStreamId: Int): HttpConnection
Like abstract fun goAway(errorCode: Long, lastStreamId: Int, debugData: Buffer): HttpConnection
Send a go away frame to the remote endpoint of the connection.
|
|
abstract fun goAwayHandler(handler: Handler<GoAway>): HttpConnection
Set an handler called when a GOAWAY frame is received. This is not implemented for HTTP/1.x. |
|
abstract fun indicatedServerName(): String
Returns the SNI server name presented during the SSL handshake by the client. |
|
abstract fun isSsl(): Boolean |
|
abstract fun localAddress(): SocketAddress |
|
abstract fun peerCertificateChain(): Array<X509Certificate>
Note: Java SE 5+ recommends to use javax.net.ssl.SSLSession#getPeerCertificates() instead of of javax.net.ssl.SSLSession#getPeerCertificateChain() which this method is based on. Use |
|
abstract fun ping(data: Buffer, pongHandler: Handler<AsyncResult<Buffer>>): HttpConnection
Send a PING frame to the remote endpoint. This is not implemented for HTTP/1.x. |
|
abstract fun pingHandler(handler: Handler<Buffer>): HttpConnection
Set an handler notified when a PING frame is received from the remote endpoint. This is not implemented for HTTP/1.x. |
|
abstract fun remoteAddress(): SocketAddress |
|
abstract fun remoteSettings(): Http2Settings |
|
abstract fun remoteSettingsHandler(handler: Handler<Http2Settings>): HttpConnection
Set an handler that is called when remote endpoint Http2Settings are updated. This is not implemented for HTTP/1.x. |
|
open fun setWindowSize(windowSize: Int): HttpConnection
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. |
|
abstract fun settings(): Http2Settings |
|
abstract fun shutdown(): HttpConnection
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. abstract fun shutdown(timeoutMs: Long): HttpConnection
Initiate a connection shutdown, a go away frame is sent and the connection is closed when all current streams will be closed or the |
|
abstract fun shutdownHandler(handler: Handler<Void>): HttpConnection
Set an handler called when a GOAWAY frame has been sent or received and all connections are closed. This is not implemented for HTTP/1.x. |
|
abstract fun sslSession(): SSLSession |
|
abstract fun updateSettings(settings: Http2Settings): HttpConnection
Send to the remote endpoint an update of the server settings. This is not implemented for HTTP/1.x. abstract fun updateSettings(settings: Http2Settings, completionHandler: Handler<AsyncResult<Void>>): HttpConnection
Send to the remote endpoint an update of this endpoint settings The |