socket.io-client-csharp icon indicating copy to clipboard operation
socket.io-client-csharp copied to clipboard

Is getting messages in order possible?

Open mike-deem-uipath opened this issue 5 months ago • 0 comments

Is there any way to get messages from a web socket in order in c#? Based on my understanding and testing, since web socket transport uses ConfigureAwait(continueOnCapturedContext: false) handlers are dispatched on arbitrary threads with no way to ensure that they are executed in the same order as the messages read from the web socket.

This is a problem when processing ordered streams of messages as needed to work with the newer voice enabled LLM apis, for example. In my case, events are streamed from the browser to a C# service, and forwarded to the LLM's API. But the event handlers are called out of order on occasion, causing garbled voice input and output streams.

mike-deem-uipath avatar Jun 18 '25 04:06 mike-deem-uipath