Skip to content

Problems with connections closing and not re-establishing #214

@JetForMe

Description

@JetForMe

What is the default expected behavior in the presence of severe network errors? We're seeing a general behavior of SwiftPhoenixClient disconnecting and not re-connecting.

Interestingly, we see two separate behaviors. Our app connects to the same ws URL with two different Sockets, and then a single channel is created for each Socket, each with a different topic (one for "auction", one for "chat").

To reproduce the behavior, I ran the code on my iPhone and set the Network Link Conditioner to "Very Bad Network." But note that our users (and even some of our devs) are reporting apparent disconnects too frequently in the field.

I see a lot of heartbeat timeouts on the auction channel, but never on the chat channel. Eventually I’ll see timeouts on the transport, and then things just close:

transport, heartbeat timeout. Attempting to re-establish connection
transport, close

What can we do here to try to keep re-establishing the connection? Does adding an error or close callback give me a good place to re-connect?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions