예제 #1
0
        static void Main(string[] args)
        {
            _tcpMod               = new DataBase.TcpModule(true);
            _tcpMod.Receive      += _tcpMod_Receive;
            _tcpMod.Accept       += _tcpMod_Accept;
            _tcpMod.Connected    += _tcpMod_Connected;
            _tcpMod.Disconnected += _tcpMod_Disconnected;
            _tcpMod.StartServer(15000);
            m_DbCollection = (DataBasesCollection)Functions.LoadConfig("DataBase.qrdb");
            if (m_DbCollection == null)
            {
                m_DbCollection = new DataBasesCollection();
            }



            Console.Read();
        }
예제 #2
0
        private void Check(object sender, EventArgs e)
        {
            if (c)
            {
                _tcpmodule.StartServer();
                c = false;
            }
            myip = Adapters();
            int    li    = myip.LastIndexOf('.');
            string ipnum = myip.Substring(0, li + 1);

            Task[] cip = new Task[5]
            {
                new Task(() => Start(ipnum, 0, 51)),
                new Task(() => Start(ipnum, 52, 102)),
                new Task(() => Start(ipnum, 103, 153)),
                new Task(() => Start(ipnum, 154, 204)),
                new Task(() => Start(ipnum, 205, 255))
            };
            foreach (var item in cip)
            {
                item.Start();
            }
        }