fix: Properly wait for client to accept connection #1058
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before: When a host requests a client to start a connection, clients were using
AcceptConnection
as if it were synchronous. In the event that a host opens a connection sufficiently faster than a client, the client may be messaged with the "READY" before it has actually accepted the remote connection. The result is that the client fails to receive the packet, does not respond to the host's connection attempt, and thus the connection cannot be made.Now: Subscribing to the
AddNotifyPeerConnectionEstablished
message and handling the results in there allows the client to properly time when they're ready for communication.Internal_OpenConnection
has been split into synchronous part (Internal_StartOpenIncomingConnection
) and asynchronous part (Internal_ContinueOpenOutgoingConnection
).Warning
This has barely been tested at the point where this is put up to PR. This pr is in draft to start with until it has been tested. Please give feedback on the approach and naming conventions. Please provide scenarios you want to see covered in tests, if you can think of anything in particular.
The testing process for this will include:
Internal_OpenConnection
withinEOSTransportManager.cs
appears to send packet before client is ready. #975 's code on top of this to reproduce the original issue and ensure it is fixed.#EOS-2255