Skip to content

Disconnect handler - #5

Open
BHandle wants to merge 4 commits into
seaeagle1:masterfrom
BHandle:DisconnectHandler
Open

Disconnect handler#5
BHandle wants to merge 4 commits into
seaeagle1:masterfrom
BHandle:DisconnectHandler

Conversation

@BHandle

@BHandle BHandle commented Jan 24, 2025

Copy link
Copy Markdown

This modifies the disconnect behavior of a Client in the following ways:

  • adds a WhenDisconnected event that allows the creator to react to the Server closing.
  • KeepAlive pings are stopped, rather than only stopping if a disconnect message is sent to the Server.
  • An Exception is prevented if Disconnect is called when the Connect did not succeed. (also required if the last bullet is accepted)
  • A KeepAlive ping failure is caught and treated as a Server disconnect, rather than bubbling the exception on the Timer.

@BHandle

BHandle commented Jan 24, 2025

Copy link
Copy Markdown
Author

When creating this, I did not personally use the encrypted or stateful variants, and I haven't echoed any changes to those implementations. It's possible that these changes should also be performed there to keep each of them in sync.

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