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

WebSocketManagerMiddleware class throws Websocket Exception when the socket is not properly closed #42

Open
viniciap opened this issue Sep 12, 2017 · 3 comments

Comments

@viniciap
Copy link

I've been struggling to find this problem for the past 24 hours.

In the WebSocketManagerMiddleware class, the awaitable Receive Task will throw an unhandled Websocket Exception that will break the application in the case of a socket not being properly closed. The ExceptionHandlerMiddleware was unable to catch it as well, not sure why.

The exact message is something like "The remote party closed the WebSocket connection without completing the close handshake."

This can probably be replicated using the mvc sample, then using a cellphone to connect to the websocket and then switching back to another process so the browser will be in background.

@mihai-burduselu
Copy link
Collaborator

mihai-burduselu commented Sep 12, 2017

I read something about this problem and I modified the method of closing the socket. I put the changes in a new branch at this link.
@v1n1akabozo, please switch to this branch, test it and tell me if the bug still persists.

@viniciap
Copy link
Author

@mihai-burduselu

I'll give it a try soon. What i did this morning was to remove the nuget dependency, use the original source and then handle all possible exceptions and now my application is stable.

@radu-matei
Copy link
Owner

Unfortunately, the NuGet is based on a lower version of the repo (that in the meantime has been updated).
Take a look at the current version, at the fix @mihai-burduselu made and if you still handle additional exceptions, please submit a pull request.

Thanks!

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

3 participants