Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

connection error #1605

Closed
mehdish3022 opened this issue Jan 24, 2024 · 2 comments
Closed

connection error #1605

mehdish3022 opened this issue Jan 24, 2024 · 2 comments
Labels
needs investigation This issue needs further investigations

Comments

@mehdish3022
Copy link

Describe the bug
I am currently utilizing Socket.IO client version 4.7.3 for my application. Upon executing the socket.disconnect(); command to sever the connection with the server, I subsequently attempt to re-establish the connection utilizing socket.connect();. However, during this process, I encounter a timeout error. Following this error, the system appears to automatically attempt reconnection procedures.
To Reproduce

Socket.IO client version: 4.7.3

Client

const socket = io("ws://localhost:3000/", {autoConnect:false});

socket.on("connect", () => {
  console.log(`connect ${socket.id}`);
});

socket.on("disconnect", () => {
  console.log("disconnect");
});
socket.on("connect_error", (error) => {
    console.error('Socket error:', error);
});

Expected behavior
I had anticipated that the socket.connect() function would operate seamlessly, logging the socket.id to the console as expected. Contrary to this expectation, there appears to be a delay of approximately 10 seconds, after which the system generates and presents an error:

Socket error: Error: timeout
    at manager.js:137:25

The socket.connect() function performs flawlessly when invoked initially. However, an issue arises when it is executed subsequent to the socket.disconnect() call, where it consistently results in an error. This discrepancy in behavior is observed only in instances where socket.connect() is used following a disconnection.

@mehdish3022 mehdish3022 added the to triage Waiting to be triaged by a member of the team label Jan 24, 2024
darrachequesne added a commit to socketio/socket.io-fiddle that referenced this issue Jan 26, 2024
@darrachequesne
Copy link
Member

Hi! I was not able to reproduce the issue: https://github.com/socketio/socket.io-fiddle/tree/issues/socket.io-client/1605

Could you please check?

@darrachequesne darrachequesne added needs investigation This issue needs further investigations and removed to triage Waiting to be triaged by a member of the team labels Jan 26, 2024
@darrachequesne
Copy link
Member

Closed due to inactivity, please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation This issue needs further investigations
Projects
None yet
Development

No branches or pull requests

2 participants