doghappy / socket.io-client-csharp

socket.io-client implemention for .NET
MIT License
733 stars 126 forks source link

:bug: Packet Id can be modified during parallel operations #336

Closed JesseKPhillips closed 1 year ago

JesseKPhillips commented 1 year ago

When executing is performed in parallel the _packetId might get updated prior to being sent across the wire. This modification ensures that the same id is used to store response handles and the emitted event.

Sorry this was edited in the web UI.

I'm pretty sure I'm currently hitting this bug and would appreciate a release with a fix :D

JesseKPhillips commented 1 year ago

I was able to work around the issue by using https://github.com/neosmart/AsyncLock around the one location I utilize EmitAsync().

Combined with behavior described in #251 I'm able to effectively remain asynchronous while waiting on responses.

doghappy commented 1 year ago

I don't think that you fixed concurrency issue, you just avoided it by accident, but the issue still exists. So I pushed a new commit to solve the issue. please let me know if you have any questions

JesseKPhillips commented 1 year ago

This has addressed my issue with parallel execution.