+The Node API for this is very simple, making it difficult to find a useful alternative behavior for `start`. The `Http2Server` class has a `listen` method, which binds and listens on a port, and automatically accepts incoming connections (and performs the TLS handshake, if applicable) and exchanges `SETTINGS` frames to establish the HTTP/2 session. Once that is complete, the gRPC gets access to the session object in a `session` event. At that point, the session has already been successfully established from the client's point of view, and the gRPC code can't undo that. The `Http2Server` class also has a `connection` event, which provides access to a `Socket` object representing the TCP socket. Closing the connection at that point results in the client seeing `ECONNRESET` instead of a `GOAWAY`, but the client still considers the connection to have been established, and does not behave differently as a result.
0 commit comments