r15238: Add some code to automatically reconnect if we want to.