Skip to content

Minor issues with reconnection behaviour #85

Description

@cloudhead

Just a couple of things I've noticed, which are easy to fix:

  • When there's a connection error, the client won't attempt to reconnect. This is because the "error" listener doesn't call connection_gone. I'm not sure if this is intentional, but it might be useful if it tried reconnecting on error (such as ECONNREFUSED) after a disconnect.
  • client.attempts is never reset. It should probably be set back to 1 in client.on_connect. I'm assuming it's only needed for the exponential backoff, and therefore should be reset after a successful connection.

If you want me to submit a patch, I can do so, but it's really just two lines of code if you want to fix this.

Cheers

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions