Ok, then why not just resend the request as long as it returns a connection error?
In the case of an internet connection failure, I'd like it to attempt to fix the failure (which might be a result of changing IPs and failing mid-way through). In this case it'd have to call RenewIP.
In the rare case of the website blocking, it actually has to change it's own IP (and it appears to have to connect directly to the router to make it reboot long enough to get a new IP assigned). The reason is, I'm running a program that archives ionospheric data from a website every 5 minutes, but it seems to be flagging up anti-denial of service attacks (I don't think once every 4-5 minutes is that severe?), of which a new IP would bypass.
Whilst normally I wouldn't raise the merits, I am trying to gather data so I can analyse the ionospheric patterns to see if they preclude earthquake events. But that's nigh on impossible if the website blocks me for hours on end (they don't even archive their own data - so every piece lost is lost permanently).
Last time I tried to contact them I didn't get a reply, so I'm not holding my breath.