|
-
Apr 18th, 2006, 06:07 AM
#1
Thread Starter
New Member
[VB.NET] Timeout WebException when connecting repeatedly to web server
Hi all,
I have a web server that I retrieve information via a Xml file from and when I call it frequently, I eventually receive a timeout exception (System.Net.WebException).
VB Code:
Public Function ReadTags() As String(,)
Dim retArray(2, 10) As String
Try
Dim m_xmlr As New XmlTextReader("http://192.168.2.40/cgi-bin/dataProxy?oper=queryTags")
m_xmlr.Read()
' ... rest of function...
Return retArray
m_xmlr.Close()
retArray = Nothing
Catch ex As Net.WebException
' Do something here
End Try
End Function
Under some circumstances, the function above can be called repeatedly, and when that happens, I want the function to handle that situation in some way so that the timeout does not occur. When the function is called repeatedly the information returned is not of any relevance so the function can just stop responding really, and just give no data back.
Maybe I should shorten the timeout to a few seconds and just grab the error an do something there, but I do not have time to wait the standard 100 seconds, that it takes the timeout exception to be generated.
I am not sure what is the standard way of dealing with this sort of problem on the Client side, so if you have any suggestions on how to handle this situation, please submit them here.
Best regards,
G
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|