private void FileTransferList(string[] filePathList, int targetPort, RemoteOnlineClientProxy proxy)
        {
            List <Task> taskList = new List <Task>();

            foreach (var path in filePathList)
            {
                Task t = new Task(() =>
                {
                    var reader = new LocalFileReader(new FileRemoteSendAdapter(targetPort, proxy), this, this);
                    reader.RunFileTransfer(path);
                });
                taskList.Add(t);
                t.Start();
            }
            Task.WaitAll(taskList.ToArray());//使用多线程上传文件
        }
        private void LanFileListTransfer(ClientToken targetToken, string[] filePathList)
        {
            IFileSender adapter      = FileUpdateClientProxy.CreateTcpProxy(targetToken.GenServiceAddress());
            var         easyTransfer = new LocalFileReader(adapter, this, this);

            List <Task> taskList = new List <Task>();

            foreach (var path in filePathList)
            {
                Task t = new Task(() =>
                {
                    //bug : appeared throw
                    easyTransfer.RunFileTransfer(path);//这个接口目前只支持局域网
                });
                taskList.Add(t);
                t.Start();
            }
            Task.WaitAll(taskList.ToArray());//使用多线程上传文件
        }
Ejemplo n.º 3
0
 public void RunFullTest(string path)
 {
     reader.RunFileTransfer(path);
 }