//组包发给子服务 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); }
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 }
public string Package(PacketInfo info) { return(JsonConvert.SerializeObject(info)); }