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

conect_timeout never fired (Websocket) #843

Closed
Patatruc opened this issue May 22, 2015 · 1 comment
Closed

conect_timeout never fired (Websocket) #843

Patatruc opened this issue May 22, 2015 · 1 comment
Milestone

Comments

@Patatruc
Copy link

Hello,

socket = io(url, {transports: ['websocket']});
socket.io.on("connect_timeout", function() { alert("timeout!"); });

The listener is never fired with the default timeout value (20000). I've tried with lower values and it is the same, except when timeout < ~5000 (IE11) or < ~8000 (Chrome). This limit is not consistent..

Is it a bug, or did I missed something ?

(socket io 1.3.5)

@darrachequesne
Copy link
Member

The connect_timeout event was removed in Socket.IO v3:

// either listen to the "connect_error" on the Socket instance
socket.on('connect_error', (err) => {
  console.log(err);
});

// or listen to the "error" on the Manager instance
socket.io.on('error', (err) => {
  console.log('manager', err);
});

See also: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#The-Socket-instance-will-no-longer-forward-the-events-emitted-by-its-Manager

@darrachequesne darrachequesne added this to the 3.0.0 milestone Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants