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

Unhandled Exception during errors in clientconnection.js #23

Open
duhiga opened this issue Dec 11, 2018 · 2 comments
Open

Unhandled Exception during errors in clientconnection.js #23

duhiga opened this issue Dec 11, 2018 · 2 comments

Comments

@duhiga
Copy link

duhiga commented Dec 11, 2018

First off, awesome library. Love it.

I'm getting unhanded exceptions and crashing when (I think) users with high latency disconnect (I think). From what I can tell this occurs if the websocket is already disconnected before clientconnection.error fires a server.emit. Handling this would look something like:

ClientConnection.js:

...
error(error) {
        try {
            this.server.emit('error', this, error);
        } catch (err) {
            this.log(this.server.LOGLEVEL.ERRORS, 'Failed to send error to client: ', error);
        }
        this.close(error);
    }
...

I have not been able to reproduce this myself, but am working off stack traces and believe this to be the issue. Can you take a look at this and perhaps add in some catching/validating at this stage?

@mrvisser
Copy link

I've experienced this fairly regularly on a high-traffic VNC connection.

I've bound a listener to server.on('error', ...) as well but it doesn't help.

@mrvisser
Copy link

The exception raised to process was actually a chain reaction from another stream I had open. So long as you listen on server.on('error'...) in your own code, should be all good.

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