Beispiel #1
0
        public RealServer(WarInfo war, Action RepBinded, Action PubBinded)
        {
            mWar = war;

            cached = ServerCached.Instance;
            cached.clear();

            RepBindCompleted = RepBinded;
            PubBindCompleted = PubBinded;

            monitor = new MonitorClient();
            monitor.startMonitor(mWar);

            EngineCfg engCfg = Core.EngCfg;

            cached.curServer = new ServerInfo()
            {
                IpAddr        = "127.0.0.1",
                PubPort       = engCfg.PubPort,
                PairPort      = engCfg.PairPort,
                HeartBeatPort = engCfg.HeartBeatPort,
                ServerName    = "Allen",
                ServerID      = DeviceInfo.GUID,
            };

            publisher = new PubServer(war, PubBindCompleted);
            Resper    = new ResponseServer(war, HandleMQMsg, RepBindCompleted);

            type      = GetType();
            c_bf      = BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance;
            cmdMethod = new Dictionary <string, MethodInfo>();
            cachedMethod();

            proxyCli = new ProxyClient(-1, publisher);
        }
Beispiel #2
0
        public HeartBeatServer(WarInfo war, MonitorClient climonitor) : base(war)
        {
            this.poller = new Poller();
            monitor     = climonitor;

            Msg = new NetMQMessage();
            Msg.Append(1);
            establish();
            //TimeOut = new t_Timer(new TimerCallback(TTimeOut), null, Timeout.Infinite, Timeout.Infinite);
        }