Exemple #1
0
        protected void InitTask()
        {
            Console.WriteLine("Starting Connect Server");
            ClientHeatLiChuangProtocol liChuangSocket1 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket2 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket3 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket4 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket5 = new ClientHeatLiChuangProtocol();

            //throughputSocket.Connect("172.16.6.114", 9999);
            liChuangSocket1.Connect("172.16.6.11", 9999);
            liChuangSocket2.Connect("172.16.6.11", 9999);
            liChuangSocket3.Connect("172.16.6.11", 9999);
            liChuangSocket4.Connect("172.16.6.11", 9999);
            liChuangSocket5.Connect("172.16.6.11", 9999);
            //liChuangSocket.Connect("172.16.6.102", 9999);
            Console.WriteLine("Connect Server Success---" + IntConnectedNum);
            int intCount = 0;

            //循环发送
            while (true)
            {
                liChuangSocket1.DoData(readBuffer, 0, 0);
                liChuangSocket2.DoData(readBuffer, 0, 0);
                liChuangSocket3.DoData(readBuffer, 0, 0);
                liChuangSocket4.DoData(readBuffer, 0, 0);
                liChuangSocket5.DoData(readBuffer, 0, 0);

                //Console.WriteLine("Send msg finished!");
                //多长时间发一次
                Thread.Sleep(1000);
                intCount++;
            }
        }
Exemple #2
0
        protected void InitTask()
        {
            Console.WriteLine("Starting Connect Server");
            ClientHeatLiChuangProtocol liChuangSocket1 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket2 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket3 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket4 = new ClientHeatLiChuangProtocol();
            ClientHeatLiChuangProtocol liChuangSocket5 = new ClientHeatLiChuangProtocol();

            liChuangSocket1.Connect(strLissenIp, intLissenPort);
            liChuangSocket2.Connect(strLissenIp, intLissenPort);
            liChuangSocket3.Connect(strLissenIp, intLissenPort);
            liChuangSocket4.Connect(strLissenIp, intLissenPort);
            liChuangSocket5.Connect(strLissenIp, intLissenPort);
            Console.WriteLine("Connect Server Success---" + IntConnectedNum);
            int intCount = 0;
            //循环发送
            //while (true)
            //{
            //    liChuangSocket1.SendData(readBuffer, 0, 0);
            //    liChuangSocket2.SendData(readBuffer, 0, 0);
            //    liChuangSocket3.SendData(readBuffer, 0, 0);
            //    liChuangSocket4.SendData(readBuffer, 0, 0);
            //    liChuangSocket5.SendData(readBuffer, 0, 0);

            //    //Console.WriteLine("Send msg finished!");
            //    //多长时间发一次
            //    Thread.Sleep(1000);
            //    intCount++;
            //}
        }