cleanup method

Future<void> cleanup()

it will cleanup the current resource

Implementation

Future<void> cleanup() async {
  await peerConnection?.close();
  peerConnection = null;
  webSocket?.close();
  webSocket = null;
  clearTimeouts();
  sessionInitialized = false;
  candidateCount = 0;
  prevCandidateCount = -1;
  errorReason = null;
  logInfo('Resources cleaned up');
}