HttpWebRequest.GetResponse Error

  • Thread starter Thread starter Claudio Di Flumeri
  • Start date Start date
C

Claudio Di Flumeri

In my application I use a sort od LiveUpdate to download updates from
internet. To do that, a .xml file hosted on an internet area contains all
the relevant information (like version, dimension, name of the file to
download etc.). To estabilish if the file .xml exists, the following
function is used:

Public Function HTTPResourceExist(ByVal IndirizzoURL As String) As
String
Dim request As HttpWebRequest
Dim response As HttpWebResponse

HTTPResourceExist= ""
request = HttpWebRequest.Create(IndirizzoURL)
Try
response = request.GetResponse
Catch ex As WebException
If ex.Status = WebExceptionStatus.ProtocolError Then
HTTPResourceExist= "No update available"
Else
HTTPResourceExist= "Error during connection"
End If
End Try
If Not response Is Nothing Then response.Close()
request.Abort()
End Function

In some cases, the GetResponse method raises an exception
(WebExceptionStatus.ProtocolError) just has the file hadn't be found. This
error happens ONLY with ADSL connections (not with dialup or other), but not
with ALL adsl connections, just with some of them. Do you know which could
be the cause of it?

Claudio
 
Hi Claudio,

Are you sure this is no firewall problem, ADSL users have earlier a firewall
than dialup users and not all of them.

Just a thought.

Cor
 
Back
Top