shouldRetry property
Check if the close event or connection error is fatal. If you return false
,
the client will fail immediately without additional retries; however, if you
return true
, the client will keep retrying until the retryAttempts
have
been exceeded.
The argument is whatever has been thrown during the connection phase.
Beware, the library classifies a few close events as fatal regardless of
what is returned here. They are listed in the documentation of the
retryAttempts
option.
@default shouldRetryDefault
Implementation
final bool Function(Object errOrCloseEvent) shouldRetry;