Skip to content

Handle connection closure #2

@WyriHaximus

Description

@WyriHaximus

Copied from WyriHaximus/php-pusher-client#4 created by @davidwdan


Connection closure

Clients may close the WebSocket connection at any time.

The Pusher server may choose to close the WebSocket connection, in which case a close code and reason will be sent.

Clients SHOULD support the following 3 ranges

4000-4099: The connection SHOULD NOT be re-established unchanged.

4100-4199: The connection SHOULD be re-established after backing off. The back-off time SHOULD be at least 1 second in duration and MAY be exponential in nature on consecutive failures.

4200-4299: The connection SHOULD be re-established immediately.

https://pusher.com/docs/pusher_protocol

This can be implemented by converting the error messages into error observables and then using retryWhen to set the back-off time.

I'll work on this when I get a chance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions