Maybe you can use asynchronous operations using
INTERNET_FLAG_ASYNC in InternetOpen() and
WININET_API_FLAG_ASYNC for all other function calls needed
This way there will be no blocking
Main Topics
Browse All TopicsHi,
I use wininet to contact a web server. But, if that web server is offline or unreachable, the timeout was TOO LONG. Almost (or more) than 2 minutes.
And nothing can be done inside application to cancel this (blocking).
So, my application freeze.
Is there any trick so I can cancel the process? or shorten the timeout value ...
Any source code example would be appreciated.
thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: KimpanPosted on 2002-11-20 at 21:37:32ID: 7476722
I think you can set timeout thru some socket function but for TCP socket, I think the timeout is 30 seconds if the server is not responding on the socket the client is trying to connect no matter what. I might be wrong.
How about pinging your web server to see if it is online before you try to connect? This works of course only if the server is online always means that you can connect to it.