Skip to content

Client socket.disconnect does not stop reconnection attempts #737

Closed
@GKTheOne

Description

@GKTheOne

Scenario one:
. client gets 401 response from server when connecting
. connect_error handler (mostly) gets called
(Firefox console usually does not show console.log output on first page load - reload and it's fine, so assuming "always" but saying "mostly" jic)
. connect_error handler calls socket.disconnect();
. client attempts to reconnect shortly thereafter

Scenario two:
. server (netty-socketio) gets connection attempt
. server rejects based on authorisation (401 response)
. server disconnects client
. client connect_error handler fires
. client attempts reconnect shortly thereafter

I'm not too worried about scenario two (because it uses the probably unsupported netty-socketio), it's just there to point out the problem is the continuous reconnection.

The main problem is that there appears to be no way to have the client code stop reconnection attempts.

This is leading to much frustration as I don't want users spamming my logs with unauthorised connection messages every ~5 seconds. (Just one message is fine though :) )

Any ideas, please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions