resumeSession method

Future<void> resumeSession({
  1. SessionResumptionConfig? sessionResumption,
})

Resumes an existing live session with the server.

This closes the current WebSocket connection and establishes a new one with the same configuration. The receive stream stays the same.

Implementation

Future<void> resumeSession(
    {SessionResumptionConfig? sessionResumption}) async {
  final previous = _core;
  _generation++;
  await previous.close().timeout(const Duration(seconds: 2),
      onTimeout: () {}); // coverage:ignore-line
  await _open(sessionResumption);
}