WebRTC-Android-SDK icon indicating copy to clipboard operation
WebRTC-Android-SDK copied to clipboard

Fix Reconnect Crash By Removing Waiting For WebSocket Connection

Open lastpeony opened this issue 1 year ago • 2 comments
trafficstars

Call init by default on webrtcClieint initialization

Call init inside publish/play only if sdk is closed previously.(stop called)

Remove waiting for WS connection with thread.sleep, move to callback style

https://github.com/ant-media/Ant-Media-Server/issues/6100

Initially, I planned to eliminate the initialization process entirely from the publish and play functions. However, upon calling the stop() function, all resources are disposed of. Consequently, calling the initialization process again becomes necessary. Samples refactored to only allow calling publish/play if websocket is connected.

This pull request breaks backward compatibility. However, I believe it's essential and worthwhile because we need to eliminate the need for waiting on WebSocket connections using thread.sleep. It represents poor design and leads to ANRs and crashes, much like the reconnect crash.

lastpeony avatar Apr 17 '24 14:04 lastpeony

do not review yet this actually didnt solve the bug. the root cause is harder than i thought.

lastpeony avatar Apr 19 '24 11:04 lastpeony

more changes added. segmentation fault fixed. i performed some comprehensive testing on my side and it worked fine. its reviewable now. @burak-58

lastpeony avatar Apr 22 '24 15:04 lastpeony

This PR is refactored and broken down to smaller PRs.

lastpeony avatar Jul 01 '24 08:07 lastpeony