recv the buffer from SOCKET, WriteFile the buffer from http header's reply to HANDLECreateFile with temporary file *.st (Axel style), terminate && close the thread when downloaded the content range. Temporary file is helpful to the server host resuming available.

Using the Code

The source file text.c is the main entry considering as a good example and testcase about how to use Axel API.

Points of Interest

Cross platform development - played with Axel console under Gentoo Linux to see the Multi-thread download accelerator working way, then ported with NATIVE WIN32 API to Windows. I complied the source code with VS2005 (Choose mbstring project setting instead of Unicode which brings ^M CTRL-V CTRL-M, unrecognized Chinese character, and binary file trash issue) under Windows 7 64-bit, so it needs more contributors to debug under other Windows distribution.

Improvement

There is WSAPoll supported only by Windows Vista, 7 && Server 2008 to determine the status of one or more sockets. It might be more efficient than WSAEventSelect.

Share

About the Author

An individual human existence should be like a river - small at first, narrowly contained within its banks, and rushing passionately past boulders and over waterfalls. Gradually the river grows wider, the banks recede, the waters flow more quietly, and in the end, without any visible break, they become merged in the sea, and painlessly lose their individual being.

Thanks for this nice article. However, it would be extremely useful to see some kind of measurement of the acceleration. Any comparison (in terms of download time) between the following 2 cases would be nice: 1- without the acceleration 2- with the acceleration.Also, the comparison should be for different sites just to prove the validity of the code.Thanks

I have no idea what you are talking about. I read the article, and there is no comparison in the article. What is the acceleration ratio of (with axel case) and (without axel) on the average? Is it 3 times faster? 4 times faster? ...etc. Does it vary widely from website to another using the same HTTP headers? That was my question.

Sorry for my simple reply, there is no comparison in my article, but there is already the comparison in UNIX/Linux geek`s mind

If you experienced Ubuntu a Linux distribution based on Debian, when installed software package under Gentoo Linux, it is better to use emerge to automatically install dependence. And emerge script choose wget as the default downloader that only support one connection. It is much slower especially when install Linux Kernel, Linux desktop such as Gnome or KDE.

So I simply answered your question as there is a comparison between wget and axel, BUT IN MY ARTICLE there is NO comparison between select and poll mentioned in the Improvement section.

Jamming1 asked a simple question. It was certinally the one I was thinking by the time I'd finished the article, nor do I believe you've answered it.

Your correct, in theory downloading a file in parallel segments should indeed be quicker, but how does it work out in reality. What happens if I want to do two or more concurrent downloads? There will be some contention depending upon your internet connection, but how much? These are not unreasonable things to want to know about a tool whose prime goal is to minimise download time.

Even without comparing your tool against other tools you should be able to demonstrate that when using your program a single connection took X amount of time, 2 connections Y amount of time etc. Then show these numbers over a range of file sizes to see how it scales.

Personally, I'm not inclinded to download, install and test software if the developer connot persuade me that there is an advantage in using their tool.