public void Initialize()
        {
            IList<TCacheHost> hosts = TCacheHostDAL.Instance.AllCacheHosts;
            foreach (TCacheHost host in hosts)
            {
                if (!_sockets.ContainsKey(host.Id))
                {
                    CommandProvider hbp = new CommandProvider(host);
                    hbp.CheckHeart();
                    _sockets.Add(host.Id, hbp);
                    PageLogger.RecordInfoLog(String.Format("CommunicationManager add command sockets {0}.{1}",
                        host.Id,
                        host.IpAddress));
                }

                if (!_signalSockets.ContainsKey(host.Id))
                {
                    RealProvider rp = new RealProvider(host);
                    rp.CheckHeart();
                    _signalSockets.Add(host.Id, rp);
                    PageLogger.RecordInfoLog(String.Format("CommunicationManager add signal sockets {0}.{1}",
                       host.Id,
                       host.IpAddress));
                }

                //EventProvider ep = new EventProvider(host);
                ////ep.CheckHeart();
                //_eventSockets.Add(host.Id, ep);
            }
        }
Example #2
0
 private void button7_Click(object sender, EventArgs e)
 {
     TCacheHost host = new TCacheHost();
     host.IpAddress = "192.168.1.191";
     host.Port = 10235;
     if (cp == null)
     {
         cp = new CommandProvider(host);
         cp.CheckHeart();
     }
     //cp.CheckComunication();
 }