Exemplo n.º 1
0
        public async Task <bool> ReconnectToServer()
        {
            Error          = "";
            CanRetry       = true;
            IsReconnecting = true;
            try
            {
                await _server.Connect(_upgrade);

                _connector = new Connector(_server, _client);

                return(true);
            }
            catch (Exception exc)
            {
                try
                {
                    Error = exc.Message;

                    if (_connector != null)
                    {
                        _connector.Dispose();
                        _connector = null;
                    }
                }
                catch { }

                return(false);
            }
        }
Exemplo n.º 2
0
        protected async Task ConnectCore(bool upgrade)
        {
            await _server.Connect(upgrade);

            if (_connector != null)
            {
                _connector.Dispose();
            }

            _connector = new Connector(_server, _client);
        }