aws-samples / amazon-ivs-broadcast-ios-sample

MIT No Attribution
17 stars 11 forks source link

Network Drop!! #65

Open yuvarajb1992 opened 6 months ago

yuvarajb1992 commented 6 months ago

Is there any solution for network drop if the user disconnects/network drops while broadcasting live and tries to reconnect within a few seconds but the broadcast stops immediately in Version: 1.13.2.

So How to overcome this issue? Kindly assist.

bclymer commented 6 months ago

Hi @yuvarajb1992 - the reason you can't immediately rebroadcast is because the previous stream is still live, because the server never had the socket closed correctly. To the server, a total network loss looks the exact same as a network hiccup (like driving through a tunnel), where the stream could resume after the connection is restored. As a result, the server has a timeout, waiting for more data on the un-closed socket before allowing a new stream.

We do have a workaround however, using the StopStream API on our AWS API Console. This will immediately end the existing scream and allow you to start a new stream. I recommend having your mobile app communicate to your backend that it should invoke StopStream, and when your backend confirms that API was successful, start a new stream.