Repository navigation
Is there a good way to track how recently data was received from the remote end of an http2 session? #21730
Description
Activity
- addedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.http2Issues and PRs related to the http2 subsystem.Issues and PRs related to the http2 subsystem.
on Jul 9, 2018 If you're looking for an application-level solution:
You could update a timestamp (
process.hrtime) every time data is received and compare it to the current time. Perhaps perform this comparison in a recurring timer.The issue here is that I am working with a http2 session object, but what I really want to track is every time data comes in on the underlying socket. That includes a variety of events on the http2 session and http2 stream objects, plus frames that don't trigger events at all, like WINDOW_UPDATE frames.
Would it cause any problems to add an additional
"data"event handler to the underlyinghttp2session.socket?This would be a bit difficult to do and would limit performance. One thing we could do is update an internal timestamp whenever data is received, but invoking a callback or event on every chunk of data would result in a significant performance loss.
That timestamp would be all I really need here.
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.and removedquestionIssues asking questions about Node.js.Issues asking questions about Node.js.
on Aug 10, 2018 Will investigate the possibilities here. Marking as a feature request.
Will investigate the possibilities here. Marking as a feature request.
@jasnell Any results to report?
I've got an open pr that I need to revisit in the next few weeks
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.
- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Feb 28, 2022 There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment.
For more information on how the project manages feature requests, please consult the feature request management document.
I am trying to detect when a connection underlying an http2 session is broken using this strategy. In short, I want to send an http2 ping when I have at least one active stream (which I can track myself) and when I have not received any data from the server. Is there a good way to determine when was the latest time that I received any data from the server?