facebookincubator / SocketRocket

A conforming Objective-C WebSocket client library.
Other
9.54k stars 2.01k forks source link

readyState is not thread safe #564

Open tinder-whitneyfoster opened 6 years ago

tinder-whitneyfoster commented 6 years ago

I recently came across this race condition when trying to read the readyState after the connection failed.

screen shot 2018-04-06 at 12 35 19 pm

The delegate method didFailWithError: is called in a separate thread than the one the readyState is set on.

Thanks!