server: Cancel call when the outgoing messages are closed (#274)

This commit is contained in:
Sigurd Meldgaard 2020-01-28 09:29:05 +01:00 committed by GitHub
parent ae17e712e4
commit 7d3b3749e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -77,6 +77,9 @@ class ServerHandler_ extends ServiceCall {
.transform(grpcDecompressor())
.listen(_onDataIdle,
onError: _onError, onDone: _onDoneError, cancelOnError: true);
_stream.outgoingMessages.done.then((_) {
cancel();
});
}
/// Cancel response subscription, if active. If the stream exits with an