Yeah, I was also unsure where to put it. This is more an optimistic approach, thinking connections are actually more up than down. If you expect connections to be down for longer periods, it might make sense to put this check in the beginning.