public static void SetEvent(UpdateInfo info) { lock (typeof(ValuesPusherComet)) { foreach (var valuesPusher in ClientList) { valuesPusher.Value.SetEvent(info); } } }
public Stream GetChanges() { var arg = new UpdateInfo(); string clientId = Guid.NewGuid().ToString(); ValuesPusherComet.RegisterCometInstance(clientId, this); if (_ev.WaitOne(Comet.TimeOut)) { lock (typeof(Comet)) { arg = _message; } } Comet.UnregisterCometInstance(clientId); var myResponseBody = JsonConvert.SerializeObject(arg); WebOperationContext.Current.OutgoingResponse.ContentType = "application/json; charset=utf-8"; return new MemoryStream(Encoding.UTF8.GetBytes(myResponseBody)); }
internal void SetEvent(UpdateInfo message) { _message = message; _ev.Set(); }
private static void OnValuesChangedEvent(UpdateInfo updateInfo) { ValuesChangedHandler handler = ValuesChangedEvent; if (handler != null) handler(updateInfo); }