question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

client can emit disconnect without a preceding connect

See original GitHub issue

It should not be possible to emit 'disconnect' without 'connect'. However, it then becomes a problem of how to make connection errors visible… do we need another event? i.e. what do we do with socket errors that occur before 'connect'.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
dnlupcommented, Apr 23, 2021

The big problem that I see with the error event is the potential uncaught exception (or maybe that’s what you meant and I didn’t get it)

0reactions
mcollinacommented, Apr 24, 2021

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

force client disconnect from server with socket.io and nodejs
socket.disconnect() can be used only on the client side, not on the server side. Client.emit('disconnect') triggers the disconnection event on the server, ...
Read more >
why socket.disconnect() on client side doesn't fire ... - GitHub
here's my code: client-side var socket = io.connect('http://' + serverAddress ,{ reconnection: false, forceNew: true } ) ...
Read more >
The Socket instance (client-side)
Besides emitting and listening to events, the Socket instance has a few attributes that may be of use in your application:
Read more >
Getting Started — Flask-SocketIO documentation
SocketIO event handlers defined as shown in the previous section can send reply messages to the connected client using the send() and emit()...
Read more >
How to manage users in socket.io in Node.js ? - GeeksforGeeks
removeUser : This function will be called whenever a connection is destroyed or a user leaves and the user name is deleted from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found