Skip to content

feat(#4230): Implement pingInterval for dispatching PING frames #4296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

metcoder95
Copy link
Member

This relates to...

Closes #4230

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

@metcoder95 metcoder95 requested review from ronag and mcollina June 26, 2025 10:17
Comment on lines 173 to 175
if (err != null) {
// TODO: should we drop the session?
client[kOnError](err)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinkin' twice, I'm over the fence of we should fail rather than actually just emit an event

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should drop the sesson if this error.

* @description Time interval between PING frames dispatch
* @default 60000
*/
pingInterval?: number;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this type needs a test

session[kHTTP2Session] = null
session[kHTTP2SessionState] = {
ping: {
interval: client[kPingInterval] === 0 ? null : setInterval(onHttp2SendPing, client[kPingInterval], session)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this interval be unref'ed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch; thought I unref'ed, let me adjust it

@metcoder95 metcoder95 requested a review from mcollina July 4, 2025 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose HTTP/2 ping
2 participants