Skip to content

reconnect() no longer disconnects already connected socket #243

Closed
@vladak

Description

@vladak

In the past reconnect() disconnected on TCP level first and then created new connection to the broker. This is no longer the case and some MQTT broker implementations will (correctly, see below) refuse such reconnect attempts due to duplicate client ID. Previously it worked because _get_connect_socket() used by connect() did self._sock.close() so I assume this changed with the conversion to the connection manager.

The spec says in 3.1.4 Response:

If the ClientId represents a Client already connected to the Server then the Server MUST disconnect the existing Client [MQTT-3.1.4-2].

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