-
Notifications
You must be signed in to change notification settings - Fork 279
Open
Labels
Description
The following is an excerpt of the code that sets up KeepAlive written in lib/src/client/http2_connection.dart
if (options.keepAlive.shouldSendPings) {
keepAliveManager = ClientKeepAlive(
options: options.keepAlive,
ping: () {
if (transport.isOpen) {
transport.ping();
}
},
onPingTimeout: () => transport.finish(),
);
transport.onFrameReceived
.listen((_) => keepAliveManager?.onFrameReceived());
}We found that the above code occasionally threw an exception when calling the transport.ping().
Sometimes an HTTP/2 Connection error occurred, starting from the http2 library side.
Therefore, we have applied the following patch to prevent the exception from flying.
transport.ping().catchError(() {
shutdown();
});I am not sure if this is the appropriate way to fix the problem, but I will report it to you.