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:
  1. Public Function ReadTags() As String(,)
  2.         Dim retArray(2, 10) As String
  3.         Try
  4.             Dim m_xmlr As New XmlTextReader("http://192.168.2.40/cgi-bin/dataProxy?oper=queryTags")
  5.  
  6.             m_xmlr.Read()
  7.  
  8.             ' ... rest of function...
  9.  
  10.             Return retArray
  11.             m_xmlr.Close()
  12.             retArray = Nothing
  13.         Catch ex As Net.WebException
  14.             ' Do something here
  15.         End Try
  16.     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