Optional
onClose?: () => MaybePromise<void>Optional
onError?: (Function to call once the connection is open
As soon as the promise is resolved the connection will be closed (and will not be re-opened automatically), so this is the best place to put your recv loop
Optional
onWait?: (wait: number) => voidOptional
strategy?: ReconnectionStrategyReadonly
paramsOptional
onClose?: () => MaybePromise<void>Optional
onError?: (Function that will be called whenever an error happens while connecting
(in which case connection
will be null) or inside onOpen
.
Function to call once the connection is open
As soon as the promise is resolved the connection will be closed (and will not be re-opened automatically), so this is the best place to put your recv loop
Optional
onWait?: (wait: number) => voidOptional
strategy?: ReconnectionStrategy
Function that will be called whenever an error happens while connecting (in which case
connection
will be null) or insideonOpen
.