MCPcopy Index your code
hub / github.com/nodejs/node / onHttp2SendPing

Function onHttp2SendPing

deps/undici/undici.js:8623–8643  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

8621 }
8622 __name(onHttp2RemoteSettings, "onHttp2RemoteSettings");
8623 function onHttp2SendPing(session) {
8624 const state = session[kHTTP2SessionState];
8625 if ((session.closed || session.destroyed) && state.ping.interval != null) {
8626 clearInterval(state.ping.interval);
8627 state.ping.interval = null;
8628 return;
8629 }
8630 session.ping(onPing.bind(session));
8631 function onPing(err, duration) {
8632 const client = this[kClient];
8633 const socket = this[kSocket];
8634 if (err != null) {
8635 const error = new InformationalError(`HTTP/2: "PING" errored - type ${err.message}`);
8636 socket[kError] = error;
8637 client[kOnError](error);
8638 } else {
8639 client.emit("ping", duration);
8640 }
8641 }
8642 __name(onPing, "onPing");
8643 }
8644 __name(onHttp2SendPing, "onHttp2SendPing");
8645 function onHttp2SessionError(err) {
8646 assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");

Callers

nothing calls this directly

Calls 4

clearIntervalFunction · 0.85
__nameFunction · 0.85
pingMethod · 0.45
bindMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…