Setting self.reconnect_max_attempts to a non-None value will limit the number of times a connection attempt will be made before quiting and raising a 'connection_failed' event.