469,286 Members | 2,547 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,286 developers. It's quick & easy.

Timing out calls to wininet.dll

Dan
I have an app that uses the wininet.dll APIs to get web pages and to post to
web forms. My problem is that some of my users systems will literally wait
an hour before an Internet call to a site that isn't responding times out.
During this time the app appears to hang since it won't do anything until it
gets a response to the HTTP request. Does anyone know of a way to enforce a
time out on calls to wininet? I have read of setting registry entries to
change the default timeout but this would affect the user's settings for
Internet Explorer and I don't want to do that. I just want to set a timeout
for my application.

Any suggestions would be appreciated!
Jul 17 '05 #1
6 8991
Is the process that is calling wininet running on a server or on each
user's workstation?

Jeramie

"Dan" <Da*@NoSpam.com> wrote in message news:<TS********************@comcast.com>...
I have an app that uses the wininet.dll APIs to get web pages and to post to
web forms. My problem is that some of my users systems will literally wait
an hour before an Internet call to a site that isn't responding times out.
During this time the app appears to hang since it won't do anything until it
gets a response to the HTTP request. Does anyone know of a way to enforce a
time out on calls to wininet? I have read of setting registry entries to
change the default timeout but this would affect the user's settings for
Internet Explorer and I don't want to do that. I just want to set a timeout
for my application.

Any suggestions would be appreciated!

Jul 17 '05 #2
Dan
"Jeramie" <j_*******@hotmail.com> wrote in message
news:d7**************************@posting.google.c om...
"Dan" <Da*@NoSpam.com> wrote in message news:<TS********************@comcast.com>... I have an app that uses the wininet.dll APIs to get web pages and to post to web forms. My problem is that some of my users systems will literally wait an hour before an Internet call to a site that isn't responding times out. During this time the app appears to hang since it won't do anything until it gets a response to the HTTP request. Does anyone know of a way to enforce a time out on calls to wininet? I have read of setting registry entries to change the default timeout but this would affect the user's settings for
Internet Explorer and I don't want to do that. I just want to set a timeout for my application.

Any suggestions would be appreciated!
Is the process that is calling wininet running on a server or on each
user's workstation?

Thanks for responding. It runs on the user's workstation.
Jul 17 '05 #3

"Dan" <Da*@NoSpam.com> wrote in message
news:TS********************@comcast.com...
I have an app that uses the wininet.dll APIs to get web pages and to post to
web forms. My problem is that some of my users systems will literally wait
an hour before an Internet call to a site that isn't responding times out.
During this time the app appears to hang since it won't do anything until it
gets a response to the HTTP request. Does anyone know of a way to enforce a
time out on calls to wininet? I have read of setting registry entries to
change the default timeout but this would affect the user's settings for
Internet Explorer and I don't want to do that. I just want to set a timeout
for my application.

Any suggestions would be appreciated!


Here is some selected poop from the MSDN library on general Win32 Internet
functions (not in VB declaration form):

InternetSetOption Function

BOOL InternetSetOption(
IN HINTERNET hInternet,
IN DWORD dwOption,
IN LPVOID lpBuffer,
IN DWORD dwBufferLength
);

dwOption:
.....
INTERNET_OPTION_CONNECT_RETRIES
Sets or retrieves an unsigned long integer value that contains the retry count
to use for Internet connection requests. If a connection attempt still fails
after the specified number of tries, the request is canceled. The default is
five retries. This option can be used on any HINTERNET handle, including a NULL
handle. It is used by InternetQueryOption and InternetSetOption.

INTERNET_OPTION_CONNECT_TIMEOUT
Sets or retrieves an unsigned long integer value that contains the time-out
value, in milliseconds, to use for Internet connection requests. If a connection
request takes longer than this time-out value, the request is canceled. This
option can be used on any HINTERNET handle, including a NULL handle. It is used
by InternetQueryOption and InternetSetOption.
.....

Hopefully this is useful.
Steve


Jul 17 '05 #4
Dan
"Steve Gerrard" <no*************@comcast.net> wrote in message
news:3v********************@comcast.com...

"Dan" <Da*@NoSpam.com> wrote in message
news:TS********************@comcast.com...
I have an app that uses the wininet.dll APIs to get web pages and to post to web forms. My problem is that some of my users systems will literally wait an hour before an Internet call to a site that isn't responding times out. During this time the app appears to hang since it won't do anything until it gets a response to the HTTP request. Does anyone know of a way to enforce a time out on calls to wininet? I have read of setting registry entries to change the default timeout but this would affect the user's settings for
Internet Explorer and I don't want to do that. I just want to set a timeout for my application.

Any suggestions would be appreciated!
Here is some selected poop from the MSDN library on general Win32 Internet
functions (not in VB declaration form):

InternetSetOption Function

BOOL InternetSetOption(
IN HINTERNET hInternet,
IN DWORD dwOption,
IN LPVOID lpBuffer,
IN DWORD dwBufferLength
);

dwOption:
....
INTERNET_OPTION_CONNECT_RETRIES
Sets or retrieves an unsigned long integer value that contains the retry

count to use for Internet connection requests. If a connection attempt still fails after the specified number of tries, the request is canceled. The default is five retries. This option can be used on any HINTERNET handle, including a NULL handle. It is used by InternetQueryOption and InternetSetOption.

INTERNET_OPTION_CONNECT_TIMEOUT
Sets or retrieves an unsigned long integer value that contains the time-out value, in milliseconds, to use for Internet connection requests. If a connection request takes longer than this time-out value, the request is canceled. This option can be used on any HINTERNET handle, including a NULL handle. It is used by InternetQueryOption and InternetSetOption.
....

Hopefully this is useful.
Steve


Steve,

Thanks very much for your help! I'm not certain how to apply the above.
What I think I really need is a good book for VB programmers on using the
Wininet API since I'm not much of a low level programmer (took a couple C
classes about 8 years ago and haven't looked at it since). Do you know of a
Wininet API for dummies type book? ;-)
Jul 17 '05 #5
Hi Dan - I'd suggest getting Dan Appleman's book on the Win32 API for
VB programmers (it should still be in print). It covers how to map
the C/C++ declarations into VB declares. I don't think it mentions
anything about the WinInet stuff, but would help with the translation.
You may also be able to find a good resource online that would give
you the same information.

Jeramie

"Dan" <Da*@NoSpam.com> wrote in message news:<_O********************@comcast.com>...
"Steve Gerrard" <no*************@comcast.net> wrote in message
news:3v********************@comcast.com...

"Dan" <Da*@NoSpam.com> wrote in message
news:TS********************@comcast.com...
I have an app that uses the wininet.dll APIs to get web pages and to post to web forms. My problem is that some of my users systems will literally wait an hour before an Internet call to a site that isn't responding times out. During this time the app appears to hang since it won't do anything until it gets a response to the HTTP request. Does anyone know of a way to enforce a time out on calls to wininet? I have read of setting registry entries to change the default timeout but this would affect the user's settings for
Internet Explorer and I don't want to do that. I just want to set a timeout for my application.

Any suggestions would be appreciated!


Here is some selected poop from the MSDN library on general Win32 Internet
functions (not in VB declaration form):

InternetSetOption Function

BOOL InternetSetOption(
IN HINTERNET hInternet,
IN DWORD dwOption,
IN LPVOID lpBuffer,
IN DWORD dwBufferLength
);

dwOption:
....
INTERNET_OPTION_CONNECT_RETRIES
Sets or retrieves an unsigned long integer value that contains the retry

count
to use for Internet connection requests. If a connection attempt still

fails
after the specified number of tries, the request is canceled. The default

is
five retries. This option can be used on any HINTERNET handle, including a

NULL
handle. It is used by InternetQueryOption and InternetSetOption.

INTERNET_OPTION_CONNECT_TIMEOUT
Sets or retrieves an unsigned long integer value that contains the

time-out
value, in milliseconds, to use for Internet connection requests. If a

connection
request takes longer than this time-out value, the request is canceled.

This
option can be used on any HINTERNET handle, including a NULL handle. It is

used
by InternetQueryOption and InternetSetOption.
....

Hopefully this is useful.
Steve


Steve,

Thanks very much for your help! I'm not certain how to apply the above.
What I think I really need is a good book for VB programmers on using the
Wininet API since I'm not much of a low level programmer (took a couple C
classes about 8 years ago and haven't looked at it since). Do you know of a
Wininet API for dummies type book? ;-)

Jul 17 '05 #6
On 14 Oct 2003 12:49:33 -0700, j_*******@hotmail.com (Jeramie) wrote:
Hi Dan - I'd suggest getting Dan Appleman's book on the Win32 API for
VB programmers (it should still be in print). It covers how to map
the C/C++ declarations into VB declares. I don't think it mentions
anything about the WinInet stuff, but would help with the translation.
You may also be able to find a good resource online that would give
you the same information.


eg: the downloadable API Guide from :

www.AllAPI.net
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Sean Barnes | last post: by
1 post views Thread by Java Writer via .NET 247 | last post: by
3 posts views Thread by Rich | last post: by
reply views Thread by Sjaakie Helderhorst | last post: by
4 posts views Thread by Galen Somerville | last post: by
reply views Thread by Nishini | last post: by
2 posts views Thread by julie.siebel | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.