Add reconnect and retry

I added some logic to handle reconnecting if it is disconnected. I added this specifically because we were getting into a situation were the connection was being terminated by RST packets and I made the included modifications to handle that scenario.

I am not sure this is an overall solution and is really ready for pulling in because I am not sure if this works with connection pools or not. I am also looking for guidance on this to see if there are any other ideas on how to better solve this problem.