Moved all reconnect code from protocol to connection.