private void BlipToDispatch ( LLUP.Notification n ) { // The publisher always ensure that each notification has its llup:id // element set so that consumers can decide whether or not // they have already processed a notification // The form of the id doesn't matter as long as it's unique. n.Id = Guid.NewGuid().ToString(); SendToAll(n); }
private void SendToAll ( LLUP.Notification n ) { if (clients.Count > 0) { byte[] blip = LLUP.Notification.Serialize(n); int loopSleep = 0; foreach (ISocketConnection client in clients) { try { client.BeginSend(blip); } finally { ThreadEx.LoopSleep(ref loopSleep); } } } }