Sorry I am confused - Why is this a while() and not an if() ?  If any exception happens while connecting below, isn't an exception thrown and we get out of this function?