Ejemplo n.º 1
0
        public override void ProcessCmd(string[] args)
        {
            if (args.Length != 2)
            {
                UnknowCommand();
                return;
            }
            List <string> workers  = new List <string>(StateHelper.GetChildren("ISE://system/state/worker"));
            string        filePath = args[1];

            foreach (string t in workers)
            {
//3.2 通知下载文件
                string[] ip =
                    t.Substring(t.LastIndexOf('/') + 1,
                                t.Length - t.LastIndexOf('/') - 1)
                    .Split(',');
                Framework.Network.Synchronous.Client transfer = new Framework.Network.Synchronous.Client(ip[0],
                                                                                                         int.Parse(ip[1]));
                ExcutePacket codePacket = new ExcutePacket(Encoding.UTF8.GetBytes(filePath), string.Empty,
                                                           string.Empty, string.Empty,
                                                           ExcutePacket.Type.Delete);
                codePacket.SetReturnAddress(Dns.GetHostName(), 8800);
                //1207
                codePacket.WaiteCallBack = false;
                transfer.Send <bool>(codePacket);
                StateHelper.Delete("ISE://File/" + filePath);
            }
        }