-
Notifications
You must be signed in to change notification settings - Fork 616
Adding Abort to C# Websocket #3352
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
base: master
Are you sure you want to change the base?
Conversation
|
||
public void Disconnect() | ||
{ | ||
isClosing = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat unrelated but we might want to clean up this logic as well. If the socket isn't in the connected or connecting states we should just not try to disconnect. If the socket is connected we should try a normal disconnection and if the socket is connecting then we should try to abort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More or less that is what this is doing. If DBConnection.Disconnect
is called by the client, the Disconnect
function is checking if the websocket is connected, and if it isn't actually connected yet, it's calling Abort
.
But to your point, I've added a check to ensure we only call Abort
if we are in the process of connecting, so we don't accidently call it if we are already disconnecting or are in a closed status.
Description of Changes
The implementation of a solution to #3044 , this adds an
Abort
function to theWebSocket
, which runs ifDisconnect
is called when theWebSocket
is not connected.API and ABI breaking changes
Not API breaking.
Expected complexity level and risk
1
Testing
Note: Before change (either on Rust of C# server), server would see 4
Debug
log entries about connecting, but not see theInfo
log about the client connection ending like would normally be seen in a disconnect. After change, server shows no log entries at all, because connection is properly aborted.