Restart data connection when stalled? Occasionally the data connection of my mobile will stall, i.e. it still looks like it does have a data connection (either "H" or "G"), but no server can be contacted.

(In particular, my ROM being a Cyanogen, the data icon will turn gray, meaning that the Google servers can't be contacted at the moment).

This is usually easily solved by switching mobile data off and on again, which is not a terrible nuisance, except sometime this stalled state goes unnoticed for hours, putting me at risk of losing important communications.


is there an easy way to detect this "stalled connection" state? preferably a way that could be used in Tasker to trigger a disable/enable mobile data cycle?
is there an app to handle these situations? I found many that seem to deal with a similar problem, i.e. when the data connection is completely lost (no "H" or "G" icon), but none that deals with this particular situation.


(This is happening on a rooted HTC Wildfire S with a Cyanogen 9 rom, but my question is not specific to it).
You can periodically check status of real connection using HTTP GET by Tasker. You can restart the Data again by Tasker in case connection is stalled.

But, its down side is that it'll drain battery faster.