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
fix: dispatch transport calls to network thread instead of worker thread
WebRTC's SctpTransport, DtlsTransport, and IceTransport are all
constructed on the network thread and assert owner_thread_->IsCurrent()
(or creator_thread_->IsCurrent()) on methods like dtls_transport(),
RegisterObserver(), UnregisterObserver(), and internal(). See the
RTC_DCHECK_RUN_ON assertions in the WebRTC source:
- pc/sctp_transport.cc lines 59, 66, 105
- pc/dtls_transport.cc lines 55, 61
- pc/ice_transport.cc line 27
The node-webrtc code was dispatching these calls to WorkerThread, which
is the wrong thread and causes a crash in debug builds:
Fatal error in: pc/sctp_transport.cc, line 105
Check failed: (owner_thread_)->IsCurrent()
Additionally, PeerConnection::GetSctpTransport() requires the network
thread (pc/peer_connection.cc line 1817).
Change all call sites to use NetworkThread(). For Stop() methods that
may be called from network-thread callbacks (e.g. OnStateChange), use
IsCurrent() to avoid a redundant BlockingCall.
0 commit comments