public void HandleNotify(IDictionary <string, string> headers, string body) { GenaNotifyResponse response = NotifyParser.Parse(headers, body); IEnumerable <GenaSubscription> subs = Subscriptions .Where(x => x.Id == response.SubscriptionId) .Select(x => x as GenaSubscription); foreach (GenaSubscription genaSubscription in subs) { genaSubscription?.FireOnNotify(response); } }
public GenaNotifyResponse Parse(IDictionary <string, string> headers, string body) { headers = new Dictionary <string, string>(headers, StringComparer.OrdinalIgnoreCase); GenaNotifyResponse response = new GenaNotifyResponse { NTS = headers["NTS"], SubscriptionId = headers["SID"], SequencyNumber = int.Parse(headers["SEQ"]), Values = ParseBody(body) }; return(response); }
public void FireOnNotify(GenaNotifyResponse response) { LastOnNotify = response; OnNotify?.Invoke(this, response); }