-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Http2Session connection failure semantics #16645
Comments
Not 100% certain but you could try |
The docs say that "socketError" is specifically used to forward errors from the underlying TCP/TLS socket. I wouldn't expect that to catch HTTP2 protocol errors that hopefully would still result in a failure to connect. |
Right, missed that part of the question. I'm not sure if it makes sense on our end to have a single event for both — there's a pretty substantial difference between a TLS failure (or some other socket issue) & an http2-related error. But I'll ping @jasnell & @mcollina — maybe they have some thoughts. |
From my point of view, if I'm trying to connect to an endpoint, what I care about is being notified that the client has successfully connected (the "connect" event) or that it has failed to connect (the event I'm looking for). For that, the specific reason for the failure is secondary. I was hoping that the "closed" event would be what I'm looking for, even if there are other situations where it could also be emitted. But the documentation isn't entirely clear about whether that event gets emitted at all before the connection is established. |
I'm reasonably certain, after reviewing the code again, that you could listen to |
The docs on events sure need more work, primarily what argument data is sent in the events (and what that data means) as I described in nodejs/help#877 as well as the flow of these events; when, if and under what circumstance they occur. |
I don't even think |
If a
Http2Session
created byhttp2.connect
fails to connect to the remote end, is there a single event that is guaranteed to be emitted, whether the failure is a TCP connection failure or a TLS or HTTP2 handshake failure, or something else?The text was updated successfully, but these errors were encountered: