acmacalister / jetfire

WebSocket (RFC 6455) client library for iOS & OS X
Apache License 2.0
519 stars 83 forks source link

deadlocks #79

Open emes opened 6 years ago

emes commented 6 years ago

We're seeing occasional deadlocks where jetfire is the only active thread. Any chance this starscream issue is also a jetfire issue? I'm guessing not.

https://github.com/daltoniam/Starscream/issues/164#issuecomment-176634701

mistal-distal commented 5 years ago

This usually comes down to application architecture, which I run into myself a lot. Was getting deadlocks until I read this part on the README.

By default dispatch_get_main_queue is used, thus making all delegate methods calls run on the main thread. It is important to note that all WebSocket processing is done on a background thread, only the delegate method calls are changed when modifying the queue. The actual processing is always on a background thread and will not pause your app.

It's very important to understand what thread model this (and other websocket libraries) run on.