Skip to content
This repository was archived by the owner on Oct 17, 2022. It is now read-only.
This repository was archived by the owner on Oct 17, 2022. It is now read-only.

Disconnect issue #62

@standevo

Description

@standevo

Hi, I have a strange behaviour when I try to manually disconnect the client. The disconnect event is firing on the server, also in logs I see that the client is disconnected but if I try to shutdown the server the client is trying to reconnect and fires with some interval error event. So, it turns out that the client was not successfully disconnected.

On client:

this.io = socketConnect(url, options);
this.io.on("connect", () => {})

...

this.io.on("error", (error: any) => {})

...

this.io.on("otherEvent", (data: any) => {})

...
// trying to disconnect manually
disconnect() {
    this.io.removeAllListeners();
    this.io.disconnect();
}

Server logs:

socket.io:client client close with reason transport close
socket.io:socket closing socket - reason transport close
socket.io-amqp removing P5ZCRTx9L28ThQGRAAAB from all rooms

Edit
I think i figured it out. In client the socket debugging was enabled also was in wrong place. So it tried to reconnect.

 enableDebug(e => {
    console.log("Debug:sockets: ", e);
});

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