Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Async HttpOpenRequest and Async operation in general

141 views
Skip to first unread message

a

unread,
Jan 25, 2001, 5:02:21 PM1/25/01
to
ok, first of all, has anybody managed to use wininet in async mode ?
I have used OpenInternet with the async flag set, then I followed to
InternetConnect, and then HttpOpenRequest; all seems good till I try
HttpSendRequest and it fails.
I have the callback set and a context value so I can't see the problem;
I always get ERROR_IO_PENDING. the thing is that according to the
microsoft docs, only InternetReadFile() and InternetQueryDataAvailable
are async, so I don't understand I could have an i/o pending.
so, if anybody managed to use asynchronos mode please let me know what
did you do to make it work.
thanks

a

unread,
Jan 25, 2001, 5:43:04 PM1/25/01
to
I have additional info on the phenomena (I think):
from the debugging I've done it seems that it does not even begin to
connect to the server until I call HttpSendRequest(). now, when I call
HttpSendRequest() it obviously fails because it is not connected yet.
Has anyone ever encountered this?

Art Gorr

unread,
Jan 26, 2001, 12:21:08 AM1/26/01
to
Your observation that "it seems that it does not even begin to connect to
the server until I call HttpSendRequest" is normal for the Http protocol.
If you conducted the test for Ftp, you would see callbacks indicating the
connection beginning with InternetConnect.

There are plenty of examples for using WinInet in async mode on this
newsgroup, MSDN, platform SDK samples, etc. I have found that in practice,
the MSDN samples leave a lot to desire, but you can build and run them to
see async mode in action.

For a tutorial, you could start with this:

"Calling Win32 Internet Functions Asynchronously"
http://msdn.microsoft.com/workshop/networking/wininet/tutorials/implement_as
ync.asp

I do not agree with your statement that only InternetReadFile() and
InternetQueryDataAvailable are async. I believe you have in fact observed
asynchronous behavior yourself when you call HttpSendRequest.

Your question regarding ERROR_IO_PENDING sounds familiar, though I have not
seen it myself in this context.

Perhaps you could post a snippet of your code that demonstrates how you are
using the WinInet API for us to review.

Art


"a" <a@a.a> wrote in message news:3A70ABF8.61FE852@a.a...

SoftLion

unread,
Jan 26, 2001, 6:05:14 AM1/26/01
to
When you get ERROR_IO_PENDING you MUST wait for an event to arrive
in your callback before attempting doing something else with wininet.

In your case the event is "60: Handle created".

Please have a look at my article on codeproject "async wininet".

--
+ + + + + + + + + + + + + + + + + + + + + +
Mr Ben http://softbird.free.fr
+ + + + + + + + + + + + + + + + + + + + + +

"Art Gorr" <ag...@lanovation.com> wrote in message news:8P7c6.886$9q6.1...@newshog.newsread.com...

Skip Williams

unread,
Jan 26, 2001, 7:29:25 AM1/26/01
to
Do you have a link to your article?

Thanks

Skip Williams


"SoftLion" <nos...@replyToGroup.com> wrote in message
news:OyKyxe4hAHA.1700@tkmsftngp04...

a

unread,
Jan 26, 2001, 4:57:20 PM1/26/01
to
http://msdn.microsoft.com/workshop/networking/wininet/tutorials/implement_async.asp

I just want to say that on MS documentation in the msdn library online it says
that only InternetReadFile() and InternetQueryDataAvailble() can be run in async
mode; the weird things is that it gives you the required Windows CE version;
don't know what the hell they are doing.
other thing is I found out that on my pc at home using InternetOpenUrl() async
is ok, but at work it doesn't, so now I have to debug....
damn microsoft with their crap
btw, did anybody have problems with the proxy settings not being used ?
The application that I wrote uses the INTERNET_OPEN_TYPE_PRECONFIG in
InternetOpen, but still a person has reported to me that he is behind a firewall
and the application did not connect at all. isn't the flag supposed to take care
of everything?
anyhow, to check the program go to http://www.planetcyclone.com

0 new messages