retryAttempts property

int retryAttempts
final

How many times should the client try to reconnect on abnormal socket closure before it errors out?

The library classifies the following close events as fatal:

  • All internal WebSocket fatal close codes (check isFatalInternalCloseCode in src/client.ts for exact list)
  • 4500: Internal server error
  • 4005: Internal client error
  • 4400: Bad request
  • 4004: Bad response
  • 4401: Unauthorized tried subscribing before connect ack
  • 4406: Subprotocol not acceptable
  • 4409: Subscriber for <id> already exists distinction is very important
  • 4429: Too many initialisation requests

These events are reported immediately and the client will not reconnect.

@default 5

Implementation

final int retryAttempts;