closeAllSessions method
Gracefully close every session.
Each close is guarded so one failing session does not prevent the others (and the transport under them) from being torn down.
Implementation
@protected
Future<void> closeAllSessions() async {
await Future.forEach(
List.of(_sessions.values),
(S session) => tryCatchIgnore(session.close),
);
_sessions.clear();
}