예제 #1
0
        //组包发给子服务
        public static void SendPackToSubService(string ip, LANAllComputerIp.ComputerStatus cs)
        {
            PacketInfo       pinfo = new PacketInfo();
            LANAllComputerIp lan   = new LANAllComputerIp();

            lan.GetLocalMachineIp();
            lan.localMachine.status = cs;
            pinfo.ip.Add(lan.localMachine);
            SoftInfo sinfo = new SoftInfo();

            sinfo.SoftName = "coach.exe";
            sinfo.status   = SoftStatus.Init;
            pinfo.soft.Add(sinfo);
            Packet pt   = new Packet();
            var    data = pt.Package(pinfo);

            Form_Main.sc.SendInfo(ip, data);
        }
예제 #2
0
        private void SendDataTest(LANAllComputerIp.ComputerStatus cs)
        {
            PacketInfo       pinfo = new PacketInfo();
            LANAllComputerIp lan   = new LANAllComputerIp();

            lan.GetLocalMachineIp();
            lan.localMachine.status = cs;
            pinfo.ip.Add(lan.localMachine);
            SoftInfo sinfo = new SoftInfo();

            sinfo.SoftName = "coach.exe";
            sinfo.status   = SoftStatus.Init;
            pinfo.soft.Add(sinfo);
            Packet pt   = new Packet();
            var    data = pt.Package(pinfo);

            sc.SendInfo(/*lan.localMachine.ip*/ "172.16.0.125", data);//206
        }
예제 #3
0
 public string Package(PacketInfo info)
 {
     return(JsonConvert.SerializeObject(info));
 }