httpsocket.get error traps

code sample:

[code]Dim fp_socket As New HTTPSocket
Dim fp_response, fpr As String
Dim fp_query,MyQuerystring As String 'myquerystring = ?parm1&Parm2, ,…

fp_query=“http://mywebsite.com/fingerprint.asp” + MyQuerystring
fp_response = fp_socket.Get( fp_query, 30 )
[/code]
The above code works fine in normal conditions.

Question. How do I trap the following errors:

  1. Server is down (mywebsite.com)
  2. My User has malware on board blocking ports.
  3. Server is busy with some other weasel using up resources.

I would think everyone who uses httpsocket would need to trap for these errors.

Any thoughts, code, error numbers are appreciated.

Malware should read antimalware, (Norton, McAffee)

The operating system sockets (and thus your application) have no way of knowing those types of reasons- it just knows it can’t make the connection. You’ll know if something has failed by looking at fp_socket.ErrorCode- but that’s as much as we or your application can know.

Bummer. If I put a line of code like this:

If fp-socket.errorcode= -1 then Msgbox "Either the server is busy, and you can try again later OR antimalware may be blocking response" End if

I assume that the error code will be a timeout for the aforementioned issues.

Is that correct?

[quote=159936:@Paul ONeill]Server is down (mywebsite.com )
My User has malware on board blocking ports.
Server is busy with some other weasel using up resources.
[/quote]

I do not think you can distinguish between the two first issues, since in both cases you simply receive no response from the server.

In the third case, if the server is not entirely stuck, it should probably respond to Ping.

I just check for an empty response.

if fp_response = "" then
   msgbox "bummer"
end

Thanks for the info.

I took Tim’s advice and send them to a web page where I tell them what to do, e.g., ensure they’re connected to the Internet, temporarily uninstall their antimalware( if installed), check with their ISP, etc.