VLprojects / mediasoup-client-swift

Swift wrapper for libmediasoupclient
MIT License
42 stars 17 forks source link

App Crash when creating and closing audio and video producers at the same time #6

Closed Mahmoud-Yousef closed 1 year ago

Mahmoud-Yousef commented 1 year ago

when i keep creating and closing audio and video producers at the same time, i get this error below and the app crashes.

libc++abi: terminating with uncaught exception of type MediaSoupClientError: Failed to set remote answer sdp: Called in wrong state: stable
terminating with uncaught exception of type MediaSoupClientError: Failed to set remote answer sdp: Called in wrong state: stable
fedulvtubudul commented 1 year ago

mediasoupclient is not thread-safe, you should not work with several Transports or several Producers or Consumers simultaneously. I'd recommend that all the mediasoupclient interaction is wrapped into a separate entity that serializes all requests onto a dedicated serial queue.