/// <summary> /// Parses the response and raises the appropriate event /// </summary> /// <param name="responseText">The raw GNTP response</param> /// <param name="state">An optional state object that will be passed into the response events associated with this request</param> protected override void OnResponseReceived(string responseText, object state) { CallbackData cd; MessageParser mp = new MessageParser(); Response response = mp.Parse(responseText, out cd); if (response.IsCallback) this.OnNotificationCallback(response, cd, state); else if (response.IsOK) this.OnOKResponse(response, state); else this.OnErrorResponse(response, state); }
/// <summary> /// Parses the response and raises the appropriate event /// </summary> /// <param name="responseText">The raw GNTP response</param> /// <param name="state">An optional state object that will be passed into the response events associated with this request</param> protected override void OnResponseReceived(string responseText, object state) { CallbackData cd; HeaderCollection headers; MessageParser mp = new MessageParser(); Response response = mp.Parse(responseText, out cd, out headers); SubscriptionResponse sr = SubscriptionResponse.FromResponse(response, headers); ResetTimerBasedOnResponse(sr); if (sr.IsOK) { this.OnOKResponse(sr); } else { this.OnErrorResponse(sr); } }