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

Fix for exceptions thrown on an unexpected client disconnection. #83

Open
wants to merge 4 commits into
base: dotnetcore3
Choose a base branch
from

Conversation

rh101
Copy link

@rh101 rh101 commented Jul 15, 2020

If a WebSocket client disconnects without initiating the close handshake, an exception is thrown since the socket will be in an invalid state, so CloseOutputAsync() shouldn't be called, since there won't be anything to receive this message.

Also, CloseAsync() expects a full close handshake, whereas a CloseOutputAsync() will simply initiate the close and not wait for any response from a client, so in this case CloseOutputAsync is the one to use.

The API has changed slightly for the ConnectionManager, since the socket must still be removed on a client disconnection that did not involve the close handshake.

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

Successfully merging this pull request may close these issues.

1 participant