private void _ReconnectWithServerInfo(LongPollServerInfo info) { if (_isOff) { return; } try { if (info == null) { // Some error happened. User one of the algorithms: // - Try push notifications? // - Check network connections and make user notifications with suggestions. // - Retry request after time out? Debug.WriteLine("LongPollServer can't get server info, so we need to do something..."); // Get time outs _RefreshServerInfo(); } else { _info = info; _SaveInfo(); _GetUpdates(); } } catch (Exception ex) { Debug.WriteLine("_ReconnectWithServerInfo failed: " + ex.Message + "\n" + ex.StackTrace); } }
public LongPollService() { _settings = new Settings(new ProtectDataAdapter()); if (_settings.Ts > -1 && !string.IsNullOrEmpty(_settings.LongPollServerKey) && !string.IsNullOrEmpty(_settings.LongPollServerUri)) { _info = new LongPollServerInfo { Ts = _settings.Ts, Key = _settings.LongPollServerKey, Server = _settings.LongPollServerUri }; } }