Exemple #1
0
 private PushMessageCollection GetMessages()
 {
     lock (this._syncRootMessageQueue)
     {
         PushMessageCollection messages = new PushMessageCollection();
         while (this.messageQueue.Count > 0)
         {
             messages.Add(this.messageQueue.Dequeue());
         }
         return(messages);
     }
 }
Exemple #2
0
        public void PushMessage(string clientid, BPMObjectNameCollection uids, string[] channels, YZMessage message, bool broadcast)
        {
            JObject jmessage = JObject.FromObject(message);

            PushMessageCollection pushMessages = new PushMessageCollection();

            foreach (string channel in channels)
            {
                PushMessage pushmessage = new BPM.PushMessage(clientid, uids, channel, jmessage);
                pushmessage.Broadcast = broadcast;
                pushMessages.Add(pushmessage);
            }

            using (BPMConnection cn = new BPMConnection())
            {
                cn.WebOpen();
                cn.Push(pushMessages);
            }
        }