private void dealDownloadFile(Socket socket, DownloadFileCo co)
        {
            DownloadFileServer server = new DownloadFileServer();

            string uuid = logReqMsg(socket, "URL:" + co.Url + ", savePath:" + co.SavePath);

            server.downloadFile(co.Url, co.SavePath,
                                delegate(DownloadFileCro cro)
            {
                logResMsg(socket, "isSuccess:" + cro.IsSuccess + ", savePath:" + cro.LocalPath + ", Message:" + cro.Message, uuid);
                // 异步调用结束
                AsyncServerSocket.getInstance().Send(socket, cro);
                server = null;
            });
        }
예제 #2
0
        private void dealDownloadFile(IWebSocketConnection socket, DownloadFileCo co)
        {
            DownloadFileServer server = new DownloadFileServer();


            logReqMsg(socket, "URL:" + co.Url + ", savePath:" + co.SavePath, co.Uuid);

            server.downloadFile(co.Url, co.SavePath,
                                delegate(DownloadFileCro cro)
            {
                cro.Uuid = co.Uuid;

                logResMsg("isSuccess:" + cro.IsSuccess + ", savePath:" + cro.LocalPath + ", Message:" + cro.Message, co.Uuid);
                // 异步调用结束
                socket.Send(CommunicateUtils.communicateVoToStr(cro));
                server = null;
            });
        }