I'm experiencing a bug where the app hangs after you call RevoltClient.StartAsync(). This only seems to happen when the app is running in debug mode.
I've done some investigating into this, and while I cannot explain why, this seems to be fixed by removing the busy wait located here. Adding a delay there fixes the problem, but well, it introduces a delay.
A better fix is to make RevoltSocketClient invoke an event to signal that it is connected. I want to add a public event RevoltEvent OnConnected to ClientEvents (RevoltEvent being a new delegate type with no parameters). Instead of busy-waiting for the websocket state to change, I want to use a TaskCompletionSource to await either this event or OnWebSocketError (returning if the former fires, and throwing if the latter fires).
I'm experiencing a bug where the app hangs after you call RevoltClient.StartAsync(). This only seems to happen when the app is running in debug mode.
I've done some investigating into this, and while I cannot explain why, this seems to be fixed by removing the busy wait located here. Adding a delay there fixes the problem, but well, it introduces a delay.
A better fix is to make RevoltSocketClient invoke an event to signal that it is connected. I want to add a
public event RevoltEvent OnConnected
to ClientEvents (RevoltEvent being a new delegate type with no parameters). Instead of busy-waiting for the websocket state to change, I want to use a TaskCompletionSource toawait
either this event or OnWebSocketError (returning if the former fires, and throwing if the latter fires).What do you think?