ConnectionSettings.MaxReconnectionAttemps - is it per drop or per lifetime?

Hi

I have a very simple question regarding MaxReconnectionAttemps from ConnectionSettings, namely is this cap individual per each connection drop or cumulative for all the dropped connections during the lifetime of the connection object?

So, to be even clearer, I have this code:

var settings = ConnectionSettings

.Create()

.KeepReconnecting()

.LimitReconnectionsTo(_settings.MaxReconnectionAttemps);

_connection = EventStoreConnection

.Create(settings, tcpAddress);

Say my limit is 10 and I had 2 drops, each ate up 3 attempts to get back online. After these 2, the third drop will have 4 available attempts left or 10?

Thank you.

Its per drop

btw for this one its helpful to read the code in the builder itself
https://github.com/EventStore/EventStore/blob/dev/src/EventStore.ClientAPI/ConnectionSettingsBuilder.cs#L167
you will also notice that limitreconnections to and keep reconnecting
don't make sense together :slight_smile:

Thank you for the pointers.

Without looking at the source code I thought the .KeepReconnecting() call is just a boolean marker to instruct the connection to attempt to revive itself, as by default it would not do it, and that the other call setting the max attempts would not have any effect unless KeepReconnecting() was called…