Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2006 Oct : Async Requests
| Subject: | Async Requests |
| Posted by: | testgam..@gmail.com |
| Date: | 3 Oct 2006 06:01:16 |
I'm trying to write an application that sends many (about 5000) http
GET requests without waiting for each call to finish.
I am using the following sequence:
1. InternetOpen (with INTERNET_FLAG_ASYNC flag)
2. InternetSetStatusCallback
3. InternetConnect
4. I loop 5000 times each time calling:
4.1. HttpOpenRequest
4.2. HttpSendRequest
I then wait to get INTERNET_STATUS_REQUEST_COMPLETE on my callback
function,
once i get it I call:
1. InternetQueryDataAvailable
2. InternetReadFile
in a loop, until there is no more data available.
I keep getting different errors, usually I fail on reading the internet
file, and then get stuck (wininet won't continue sending me
REQUEST_COMPLETE statuses.
Can someone please help me understand where my problem is? Maybe there
is a sample out there that does just this (send many GET requests)?
Thanks!