ClientHttp2Session
Properties
Value will be undefined
if the Http2Session
is not yet connected to a socket, h2c
if the Http2Session
is not connected to a TLSSocket
, or will return the value of the connected TLSSocket
's own alpnProtocol
property.
Will be true
if this Http2Session
instance is still connecting, will be set to false
before emitting connect
event and/or calling the http2.connect
callback.
A prototype-less object describing the current local settings of this Http2Session
. The local settings are local to thisHttp2Session
instance.
If the Http2Session
is connected to a TLSSocket
, the originSet
property will return an Array
of origins for which the Http2Session
may be considered authoritative.
Indicates whether the Http2Session
is currently waiting for acknowledgment of a sent SETTINGS
frame. Will be true
after calling the http2session.settings()
method. Will be false
once all sent SETTINGS
frames have been acknowledged.
A prototype-less object describing the current remote settings of thisHttp2Session
. The remote settings are set by the connected HTTP/2 peer.
Provides miscellaneous information about the current state of theHttp2Session
.
Functions
Gracefully closes the Http2Session
, allowing any existing streams to complete on their own and preventing new Http2Stream
instances from being created. Once closed, http2session.destroy()
might be called if there are no open Http2Stream
instances.
Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbol
s.
Returns the current max listener value for the EventEmitter
which is either set by emitter.setMaxListeners(n)
or defaults to {@link defaultMaxListeners}.
Transmits a GOAWAY
frame to the connected peer without shutting down theHttp2Session
.
Sends a PING
frame to the connected HTTP/2 peer. A callback
function must be provided. The method will return true
if the PING
was sent, false
otherwise.
For HTTP/2 Client Http2Session
instances only, the http2session.request()
creates and returns an Http2Stream
instance that can be used to send an HTTP/2 request to the connected server.
Sets the local endpoint's window size. The windowSize
is the total window size to set, not the delta.
By default EventEmitter
s will print a warning if more than 10
listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners()
method allows the limit to be modified for this specific EventEmitter
instance. The value can be set to Infinity
(or 0
) to indicate an unlimited number of listeners.
Used to set a callback function that is called when there is no activity on the Http2Session
after msecs
milliseconds. The given callback
is registered as a listener on the 'timeout'
event.