You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.
HubProxy.Subscribe() accesses the _subscriptions list in a non-thread safe manner. This causes data to be sent to the wrong onData callback.
Steps to reproduce
If you call IHubProxy.On(eventName, onData) (which in turn calls HubProxy.Subscribe) lots of times from different threads at the same time, data from one event may be delivered to another onData callback.
Adding a lock around the On() call prevents the issue.
The text was updated successfully, but these errors were encountered:
Expected behavior
HubProxt.Subscribe(eventName) should be thread safe, according to documentation here:
https://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-net-client
And here:
http://stackoverflow.com/questions/16089876/signalr-hubproxy-invoke-thread-safety
(However, it's stated to be non-thread safe here:
https://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.client.hubs.hubproxy(v=vs.111).aspx)
Actual behavior
HubProxy.Subscribe() accesses the _subscriptions list in a non-thread safe manner. This causes data to be sent to the wrong onData callback.
Steps to reproduce
If you call IHubProxy.On(eventName, onData) (which in turn calls HubProxy.Subscribe) lots of times from different threads at the same time, data from one event may be delivered to another onData callback.
Adding a lock around the On() call prevents the issue.
The text was updated successfully, but these errors were encountered: