reconnect method

Future<void> reconnect()

Enforces to reconnect with the incoming service.

Also compare disconnect. Also compare connect.

Implementation

Future<void> reconnect() async {
  await _incomingLock.synchronized(() => _incomingMailClient.disconnect());
  // the reconnect loop must not run under the incoming lock: it retries
  // until disconnect() is called, which needs the lock as well, and it
  // lists the mailboxes through this client when required
  await _incomingMailClient.reconnect();
  _isConnected = true;
}