HttpConnection

Represents an HTTP connection.

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

  • @see \io\vertx\jphp\core\http\HttpConnection::close
  • @see \io\vertx\jphp\core\http\HttpConnection::closeHandler
  • @see \io\vertx\jphp\core\http\HttpConnection::exceptionHandler
package

Default

Methods

__construct

__construct() 

Close the connection and all the currently active streams.

close() : void

An HTTP/2 connection will send a frame before.

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

closeHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

Set an handler called when a connection error happens

exceptionHandler( $arg0) : $this

Arguments

$arg0

callable

Response

$this

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

getWindowSize

getWindowSize() : integer

Response

integer

the current connection window size or {@code -1} for HTTP/1.x

Like @see \io\vertx\jphp\core\http\HttpConnection::goAway with a last stream id <code>-1</code> which means to disallow any new stream creation.

goAway( $arg0,  $arg1 = null,  $arg2 = null) : $this

param $errorCode [integer] goAway($errorCode)

Like @see \io\vertx\jphp\core\http\HttpConnection::goAway with no buffer.

param $errorCode [integer] param $lastStreamId [integer] goAway($errorCode, $lastStreamId)

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.

param $errorCode [integer] the {@literal GOAWAY} error code param $lastStreamId [integer] the last stream id param $debugData [Buffer] additional debug data sent to the remote endpoint goAway($errorCode, $lastStreamId, $debugData)

Arguments

$arg0

integer

$arg1

integer

$arg2

Buffer

Response

$this

Set an handler called when a frame is received.

goAwayHandler( $arg0) : $this

This is not implemented for HTTP/1.x.

Arguments

$arg0

callable

Response

$this

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

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

indicatedServerName() : string

Response

string

the indicated server name

isSsl

isSsl() : boolean

Response

boolean

true if this {@link io.vertx.core.http.HttpConnection} is encrypted via SSL/TLS.

localAddress

localAddress() : \io\vertx\jphp\core\net\SocketAddress

Response

\io\vertx\jphp\core\net\SocketAddress

the remote address for this connection

Send a frame to the remote endpoint.

ping( $arg0,  $arg1) : $this

This is not implemented for HTTP/1.x.

Arguments

$arg0

Buffer

$arg1

callable

Response

$this

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

Set an handler notified when a frame is received from the remote endpoint.

pingHandler( $arg0) : $this

This is not implemented for HTTP/1.x.

Arguments

$arg0

callable

Response

$this

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

remoteAddress

remoteAddress() : \io\vertx\jphp\core\net\SocketAddress

Response

\io\vertx\jphp\core\net\SocketAddress

the remote address for this connection

remoteSettings

remoteSettings() : \io\vertx\jphp\core\http\Http2Settings

Response

\io\vertx\jphp\core\http\Http2Settings

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

Set an handler that is called when remote endpoint @see \io\vertx\jphp\core\http\Http2Settings are updated.

remoteSettingsHandler( $arg0) : $this

This is not implemented for HTTP/1.x.

Arguments

$arg0

callable

Response

$this

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

settings

settings() : \io\vertx\jphp\core\http\Http2Settings

Response

\io\vertx\jphp\core\http\Http2Settings

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

Update the current connection wide window size to a new size.

setWindowSize( $arg0) : $this

Increasing this value, gives better performance when several data streams are multiplexed

This is not implemented for HTTP/1.x.

Arguments

$arg0

integer

Response

$this

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

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.

shutdown( $arg0 = null) : $this

This is not implemented for HTTP/1.x.

shutdown()

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.

param $timeoutMs [integer] the timeout in milliseconds shutdown($timeoutMs)

Arguments

$arg0

integer

Response

$this

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

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

shutdownHandler( $arg0) : $this

This is not implemented for HTTP/1.x.

Arguments

$arg0

callable

Response

$this

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

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

updateSettings( $arg0,  $arg1 = null) : $this

This is not implemented for HTTP/1.x.

param $settings [Http2Settings | array] the new settings updateSettings($settings)

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.

param $settings [Http2Settings | array] the new settings param $completionHandler [callable] the handler notified when the settings have been acknowledged by the remote endpoint updateSettings($settings, $completionHandler)

Arguments

$arg0

array | Http2Settings

$arg1

callable

Response

$this

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