OptionalonClose?: () => MaybePromise<void>OptionalonError?: (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
OptionalonWait?: (wait: number) => voidOptionalstrategy?: ReconnectionStrategyReadonlyparamsOptionalonClose?: () => MaybePromise<void>OptionalonError?: (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
OptionalonWait?: (wait: number) => voidOptionalstrategy?: ReconnectionStrategy
Function that will be called whenever an error happens while connecting (in which case
connectionwill be null) or insideonOpen.