예제 #1
0
        /// <summary></summary>
        /// <param name="listenDrawerPortMin">監聽 Udp Port 的最小值</param>
        /// <param name="listenDrawerPortMax">監聽 Udp Port 的最大值</param>
        /// <param name="bindLocalIp">本地端 繫結 的IP</param>
        /// <param name="bindLocalPort">本地端 繫結 的port</param>
        public MvaKjMachineDrawerManager(int listenDrawerPortMin, int listenDrawerPortMax, int sysStartUpEventListenPort) : this()
        {
            Action initialPortStatusDictionary = () => {
                PortStatusDictionary = new Dictionary <int, bool?>();
                for (int i = listenDrawerPortMin; i <= listenDrawerPortMax; i++)
                {
                    PortStatusDictionary.Add(i, default(bool?));
                }
            };

            initialPortStatusDictionary();
            SysStartUpEventListener = new SysStartUpEventListener(sysStartUpEventListenPort);
            ListenSystStartUpEvent();
        }
        /// <summary></summary>
        /// <param name="listenDrawerPortMin">監聽 Udp Port 的最小值</param>
        /// <param name="listenDrawerPortMax">監聽 Udp Port 的最大值</param>
        /// <param name="bindLocalIp">本地端 繫結 的IP</param>
        /// <param name="bindLocalPort">本地端 繫結 的port</param>
        /// <remarks>
        /// <para>暫時保留</para>
        /// </remarks>
        public MvaKjMachineDrawerLddPool(int listenDrawerPortMin, int listenDrawerPortMax, int sysStartUpEventListenPort, bool isFake) : this()
        {
            /**設定可用 Port 的最初狀況狀*/
            Action initialPortStatusDictionary = () =>
            {
                PortStatusDictionary = new Dictionary <int, bool?>();
                for (int i = listenDrawerPortMin; i <= listenDrawerPortMax; i++)
                {
                    PortStatusDictionary.Add(i, default(bool?));
                }
            };

            initialPortStatusDictionary();
            if (!isFake)
            {
                SysEventListener = new SysStartUpEventListener(sysStartUpEventListenPort);
                ListenSystStartUpEvent();
            }
        }
 public void SetSysStartUpEventListener(SysStartUpEventListener listener)
 {
     SysEventListener = listener;
 }