withAutomaticReconnect method

HubConnectionBuilder withAutomaticReconnect({
  1. IRetryPolicy? reconnectPolicy,
  2. List<int>? retryDelays,
})

Implementation

HubConnectionBuilder withAutomaticReconnect(
    {IRetryPolicy? reconnectPolicy, List<int>? retryDelays}) {
  assert(_reconnectPolicy == null);

  if (reconnectPolicy == null && retryDelays == null) {
    _reconnectPolicy = DefaultRetryPolicy();
  } else if (retryDelays != null) {
    _reconnectPolicy = DefaultRetryPolicy(retryDelays: retryDelays);
  } else {
    _reconnectPolicy = reconnectPolicy;
  }

  return this;
}