private void ResendDataToClient()
        {
            var bufferedMessages = WebSocketEventProcessor.GetAllBufferedMessages();

            this.Send(JsonConvert.SerializeObject(new Dictionary <string, object>
            {
                { "bulkData", true }
            }
                                                  ));

            try
            {
//                IList<string> filteredMessages = new List<string>();
                foreach (var message in bufferedMessages.Values)
                {
                    if (Filter(message))
                    {
                        //                       filteredMessages.Add(JsonConvert.SerializeObject(message));
                        this.Send(JsonConvert.SerializeObject(message));
                    }
                }
                //foreach (var payload in filteredMessages)
                //{
                //    this.Send(payload);
                //}
            }
            finally
            {
                this.Send(JsonConvert.SerializeObject(new Dictionary <string, object>
                {
                    { "bulkData", false }
                }
                                                      ));
            }
        }
Esempio n. 2
0
        public void ResendDataToClient()
        {
            var bufferedMessages = WebSocketEventProcessor.GetAllBufferedMessages();

            this.Send(JsonConvert.SerializeObject(new Dictionary <string, object>
            {
                { "bulkData", true }
            }
                                                  ));


            foreach (var message in bufferedMessages)
            {
                this.SendFiltered(message);
            }

            this.Send(JsonConvert.SerializeObject(new Dictionary <string, object>
            {
                { "bulkData", false }
            }
                                                  ));
        }