Esempio n. 1
0
                  public void GetAllSVDBData()
                  {
                        
                        try
                        {
                              ErrorLog Log = new ErrorLog();
                              Log.WriteFiles(DateTime.Now.ToString() + "—" + "GetSVDBDataBuffer" + "—GetAllSVDBData_A");
                              string XFireUrl = Log.ReadFile();
                              XFireUrl = XFireUrl.Split(new char[1] { '=' })[1].Trim();
                              UserPermissionContext.Instance.Url = "http://"+ConfigManager.XfireUrl +"//webservice//InterfaceEccService";

                              ITreeDao treeDao = MicroKernelUtil.GetDefaultKernel()[typeof(ITreeDao)] as ITreeDao;
                              IList<NameValueCollection> tree = treeDao.GetAll2();
                              Dictionary<XmppSeverConnection, string> ReturnStr = new Dictionary<XmppSeverConnection, string>();
                              if (m_DataBuffer.Count < 1)
                              {
                                    m_DataBuffer.Add(tree);
                              }
                              else
                              {
                                    ReturnStr = CompareDataState(tree);
                                    m_DataBuffer.RemoveAt(0);
                                    m_DataBuffer.Add(tree);
                                    if (ReturnStr.Count == 0)
                                    {
                                          return;
                                    }
                                    foreach (XmppSeverConnection key in ReturnStr.Keys)
                                    {
                                          
                                          if (ReturnStr[key] != "Norefresh")
                                          {

                                                

                                                List<string> SentStrList = new List<string>();

                                                //if (ReturnStr.Length > 8192)
                                                //{
                                                //      SentStrList = GetbatchdisableSendList(ReturnStr, "refresh<");

                                                //}
                                                //else
                                                {
                                                      string sendStr = ReturnStr[key];
                                                      sendStr = sendStr + ">stop";
                                                      key.Send(sendStr);
                                                      //XmppServer.ClientConnectionList[i].Send(SentStrList[j]);
                                                      System.Threading.Thread.Sleep(1000);
                                                }

                                                //if (XmppServer.IsSendData)
                                                //{
                                                //if (SentStrList == null || SentStrList.Count == 0)
                                                //{
                                                //      for (int i = 0; i < XmppServer.ClientConnectionList.Count; i++)
                                                //      {
                                                //            XmppServer.ClientConnectionList[i].Send(ReturnStr);
                                                //            System.Threading.Thread.Sleep(1000);
                                                //      }
                                                //}
                                                //else
                                                //{
                                                //      for (int j = 0; j < SentStrList.Count; j++)
                                                //      {
                                                //            for (int i = 0; i < XmppServer.ClientConnectionList.Count; i++)
                                                //            {
                                                //                  XmppServer.ClientConnectionList[i].Send(SentStrList[j]);
                                                //                  System.Threading.Thread.Sleep(1000);
                                                //            }
                                                //      }
                                                //}

                                                //      System.Threading.Thread.Sleep(5000);
                                                //      List<string> ClientResponseKeyList = new List<string>();
                                                //      if (XmppServer.ClientResponseList.Count > 0)
                                                //      {
                                                //            foreach (string key in XmppServer.ClientResponseList.Keys)
                                                //            {
                                                //                  ClientResponseKeyList.Add(key);
                                                //                  if (!XmppServer.ClientResponseList[key])
                                                //                  {
                                                //                        for (int i = 0; i < XmppServer.ClientConnectionList.Count; i++)
                                                //                        {
                                                //                              if (XmppServer.ClientConnectionList[i].ClientIPAddress == key)
                                                //                              {
                                                //                                    if (SentStrList == null || SentStrList.Count == 0)
                                                //                                    {
                                                //                                          //for (int i = 0; i < XmppServer.ClientConnectionList.Count; i++)
                                                //                                          {
                                                //                                                XmppServer.ClientConnectionList[i].Send(ReturnStr);
                                                //                                                //System.Threading.Thread.Sleep(1000);
                                                //                                          }
                                                //                                    }
                                                //                                    else
                                                //                                    {
                                                //                                          for (int j = 0; j < SentStrList.Count; j++)
                                                //                                          {
                                                //                                                //for (int i = 0; i < XmppServer.ClientConnectionList.Count; i++)
                                                //                                                {
                                                //                                                      XmppServer.ClientConnectionList[i].Send(SentStrList[j]);
                                                //                                                      //System.Threading.Thread.Sleep(1000);
                                                //                                                }
                                                //                                          }
                                                //                                    }
                                                //                              }
                                                //                        }


                                                //                  }
                                                //                  else
                                                //                  {

                                                //                  }
                                                //            }
                                                //            for (int i = 0; i < ClientResponseKeyList.Count; i++)
                                                //            {
                                                //                  if (XmppServer.ClientResponseList.ContainsKey(ClientResponseKeyList[i]))
                                                //                  {
                                                //                        XmppServer.ClientResponseList[ClientResponseKeyList[i]] = false;
                                                //                  }
                                                //            }
                                                //      }

                                                //}
                                                Log.WriteFiles(DateTime.Now.ToString() + "—" + "GetSVDBDataBuffer" + "—GetAllSVDBData_B");

                                          }
                                    }
                              }

                        }
                        catch (Exception ex)
                        {
                        }

                        
                  }