Future connect()

Connects the link to the broker.

Source

Future connect() {
  if (_connectedCompleter == null) {
    _connectedCompleter = new Completer();
  }

  if (!_configured || !_initialized) {
    init();
  }

  if (_ready) {
    link.onConnected.then(_connectedCompleter.complete);
    if (link != null) link.connect();
  } else {
    _connectOnReady = true;
  }
  return _connectedCompleter.future;
}