webrequest.getresponse timeout not working

S

Steve

Hi All

I have a windows forms application in VB.net 2008

My app can send SMS appt reminders via an SMS website

One of the first tasks is to read their account balance with the SMS company
as it is works on prepaid credits only

When I try to connect using the following code at the GetResponse call there
is no timeout happening after 5 Seconds if the web site is unreachable

It takes approx 30 seconds before the method call returns with connection
timed out

My understanding is the WebRequest.Timeout property should cause the method
call to abort after 5 seconds if no response has been received

Partial Code....---------------------------
Dim url As String =
"http://www.smsglobal.com.au/http-api.php?action=balancesms&user=" &
globalsmsuser & "&password=" & globalsmspwd

myWebRequest = Net.WebRequest.Create(url)

myWebRequest.Timeout = 5000

myWebRequest.Credentials = Net.CredentialCache.DefaultCredentials

myWebResponse = myWebRequest.GetResponse() ***************** hangs here

----------------------------------------------------------------------------

Am I doing something wrong?

Regards

Steve
 
C

Colbert Zhou [MSFT]

Hello Steve,

The managed support service of the newsgroup
microsoft.public.dotnet.languages.vb is now available instead on VB.NET
General: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/threads.
Would you please repost the question in the forum with the Windows Live ID
used to access your Subscription benefits? Our engineers will assist you in
the new platform. The article
http://msdn.microsoft.com/en-us/subscriptions/aa974230.aspx introduces more
information about the migration. In the future, please post your
VB.NET-related questions directly to the forums. If you have any questions
or concerns, please feel free to contact us: (e-mail address removed).

Regards,
Colbert Zhou
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup and Forum support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top