Send all the files in a folder to the client. The size of each file is no greater than 200 kb. How can this problem be solved? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiNetwork/html/delphi_20061217181039107.html
First, a list of all the file names in a folder is obtained and sent to the client cyclically. Is there any efficient method?
Define a data packet.
For example, the package length, file name, and file content
The client returns a result after receiving the message.
This way, you can send it all the time.
You are asking others how to write a software.
It's not just a few words that can solve the problem.
I think your question is not accurate enough:
The following describes how to consider this issue from the perspective of the server and client. For more information, see:
Server:
I. Do a good job in concurrent processing. If necessary, you can use the complete port. If you are in trouble, you can select the asynchronous message or event mode; 2. Support data acquisition in Content-Length/rang mode like IIS (this function can be left unspecified if it is only used to meet the needs of K files );
Client:
I. multithreading is necessary, such as flashget and Xunlei. And a file list, you can allocate the files in the list to different threads for download. Depending on the situation, the number of threads is not too large. Refer to the number of threads for software such as flashget!
In addition, you can find some stream compression mechanisms.ArticleFor more information, see!