closeSessions method

Future<void> closeSessions()

Closes every open session. Called when the node stops or the hub connection drops — an orphaned session would otherwise hold its object read open until it timed out.

Implementation

Future<void> closeSessions() async {
  for (final id in _reads.keys.toList()) {
    _closeRead(id);
  }
  for (final id in _uploads.keys.toList()) {
    await _abortUpload(id, 'connection closed');
  }
}