Skip to content

fix: Fix handling of disconnection events in the adapter #1673

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

Merged
merged 6 commits into from
Feb 10, 2022

Conversation

simon-lemay-unity
Copy link
Contributor

MTT-2467

How the adapter handled Disconnect events from the transport needed to be fixed in two ways:

  1. Send and receive queues were not cleared, meaning memory would stay allocated for nothing.
  2. The m_State would be set to Disconnected, but that should only be done on clients. Hosts have their m_State set to Listening and it should stay that way after a client has disconnected. This is likely what was causing MTT-2467.

This PR also brings in changes from PR #1649 since it provides a clean way of clearing the send queues. I also modified the connection tests to improve their stability (waiting for the client to be connected since this guarantees the server also is, otherwise there could be timing issues where the server is connected but not the client).

Changelog

com.unity.netcode.adapter.utp

  • Fixed: Fixed and issue where a server would fail to disconnect a client if another client had previously disconnected itself.

Testing and Documentation

  • Includes unit/integration tests.
  • No documentation changes or additions were necessary.

@NoelStephensUnity NoelStephensUnity merged commit dba6233 into develop Feb 10, 2022
@NoelStephensUnity NoelStephensUnity deleted the fix/disconnect-event-handling branch February 10, 2022 15:54
@ashwinimurt
Copy link
Contributor

cc @zain-mecklai

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.

4 participants