Socket.io - Client 3.0.0+ reconnect event all failed
See original GitHub issueSocket.io - Client 3.0.0+ reconnect event all failed.
Switch to version 2.3.1 and it works.
const io = require('socket.io-client');
let socket = io.connect('ws://127.0.0.1:8000', {
"transports": ['websocket', 'polling'],
reconnection: true
});
socket.on('connect', function(data){
onlineFlag = true;
console.log(data + ' - connect');
});
socket.on('connect_error', function(data){
console.log(data + ' - connect_error');
});
socket.on('connect_timeout', function(data){
console.log(data + ' - connect_timeout');
});
socket.on('error', function(data){
console.log(data + ' - error');
});
socket.on('disconnect', function(data){
onlineFlag = false;
console.log(data + ' - disconnect');
});
socket.on('reconnect', function(data){
console.log(data + ' - reconnect');
});
socket.on('reconnect_attempt', function(data){
console.log(data + ' - reconnect_attempt');
});
socket.on('reconnecting', function(data){
console.log(data + ' - reconnecting');
});
socket.on('reconnect_error', function(data){
console.log(data + ' - reconnect_error');
});
socket.on('reconnect_failed', function(data){
console.log(data + ' - reconnect_failed');
});
socket.on('ping', function(data){
console.log(data + ' - ping');
});
socket.on('pong', function(data){
console.log(data + ' - pong');
});
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Migrating from 2.x to 3.0 - Socket.IO
Catch-all listeners; Volatile events (client); Official bundle with the ... reconnect_failed, reconnection failure after all attempts, - ...
Read more >socket.io javascript client fails to reconnect after restarting server
I listen to a "disconnect" event to rebind a new 'connect' event. This way, if you server is restarted, the local client will...
Read more >socket_io_client | Dart Package - Pub.dev
Dartlang port of socket.io-client for web, flutter, dartvm to use. ... as this will cause all event handlers to get registered/fired twice. See...
Read more >socket.io-client - npm
The source code of the website can be found here. Contributions are welcome! Debug / logging. In order to see all the client...
Read more >socket.io-client | Yarn - Package Manager
socket.io-client. owner socketio19.1mMIT4.5.4TS vulns 0 vulnerabilities. Realtime application framework client. realtime, framework, websocket, tcp ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@newpanjing hi! What do you mean by “reconnect event all failed” ?
As pointed out by @tannerkrewson (thanks!), the Socket instance no longer emits any reconnection events.
Would it be possible to have a warning message in the console if someone tries to use those events on the socket itself? I think that would be super helpful for people migrating, instead of it silently failing. 😄