ServerHttp2Session
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
Alias for emitter.on(eventName, listener)
.
Submits an ALTSVC
frame (as defined by RFC 7838) to the connected client.
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.
Synchronously calls each of the listeners registered for the event named eventName
, in the order they were registered, passing the supplied arguments to each.
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
.
Returns the number of listeners listening for the event named eventName
. If listener
is provided, it will return how many times the listener is found in the list of the listeners of the event.
Returns a copy of the array of listeners for the event named eventName
.
Alias for emitter.removeListener()
.
Adds the listener
function to the end of the listeners array for the event named eventName
. No checks are made to see if the listener
has already been added. Multiple calls passing the same combination of eventName
and listener
will result in the listener
being added, and called, multiple times.
Adds a one-time listener
function for the event named eventName
. The next time eventName
is triggered, this listener is removed and then invoked.
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.
Adds the listener
function to the beginning of the listeners array for the event named eventName
. No checks are made to see if the listener
has already been added. Multiple calls passing the same combination of eventName
and listener
will result in the listener
being added, and called, multiple times.
Adds a one-timelistener
function for the event named eventName
to the beginning of the listeners array. The next time eventName
is triggered, this listener is removed, and then invoked.
Returns a copy of the array of listeners for the event named eventName
, including any wrappers (such as those created by .once()
).
Removes all listeners, or those of the specified eventName
.
Removes the specified listener
from the listener array for the event named eventName
.
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.