awaiting ClientWebSocket.RecieveAsync only recieves one packet of information, and then all other awaits never return
I’m using the System.Net.WebSockets.ClientWebSocket class in C# .NET 6.0.
I have a timer set up that repeatedly will poll the websocket for connections, shown here. The timer is elapsed every 16 ms.
When the packet is recieved, it’ll deserialize it as JSON and create an event. This works, but it only does it once.
I added the print lines for testing: Console.WriteLine(“Awaiting started”) and Console.WriteLine(“Awaiting ended”). Awaiting started should be printed when the websocket is polled. It should print Awaiting ended after the websocket has finished the polling, and then if the packet recieved isn’t empty, it’ll deserialize it.