question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot retry connection after switching network

See original GitHub issue

I’m trying to reconnect after switching network but i got an error

java.lang.IllegalStateException
        at android.media.MediaCodec.native_stop(Native Method)
        at android.media.MediaCodec.stop(Unknown Source:0)
        at com.pedro.encoder.BaseEncoder.stop(BaseEncoder.java:35)
        at com.pedro.encoder.video.VideoEncoder.reset(VideoEncoder.java:174)
        at com.pedro.rtplibrary.base.Camera2Base.resetVideoEncoder(Camera2Base.java:392)
        at com.pedro.rtplibrary.base.Camera2Base.reTry(Camera2Base.java:456)
override fun onConnectionFailedRtmp(reason: String?) {
        if (rtmpCamera.shouldRetry(reason)) {
            rtmpCamera.reTry(2000)
        }
 }

Step to reproduce

  1. start stream
  2. turn-off wifi and turn on LTE
  3. onConnectionFailedRtmp will triggered and call rtmpCamera.reTry(2000)
  4. an error occurred.

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
pedroSG94commented, Oct 28, 2019

I was doing multiple test, but in my case this only fail when I dont do retry in main thread. Can you test with this code?

override fun onConnectionFailedRtmp(reason: String?) {
    runOnUiThread {
      if(rtmpCamera.shouldRetry(reason)){
          rtmpCamera.reTry(2000)
      }
    }
  }
0reactions
beerpcccommented, Oct 30, 2019

It’s work, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Steam Connection Error Could Not Connect To ... - YouTube
Fix Steam App Not Launching Connection Error Could Not Connect To The Steam Network Retry ConnectionStep 1) Make sure your connected to ...
Read more >
How to Eliminate Steam Network Connection Errors - Lifewire
To do this, select Steam > Go Online > Connect to the Internet > Restart Steam. When you receive the Can't connect to...
Read more >
Fix network connection issues in Windows - Microsoft Support
Try these things to troubleshoot network connection issues in Windows 11. Make sure Wi-Fi is on. Select Start > Settings > Network &...
Read more >
Steam “retry connection” - Reddit
Everytime I try to log in, steam is offline or telling me that I need to retry connection or go to offline mode....
Read more >
Fixed: Could Not Connect to Steam Network [Complete Guide]
Solution 1. Change Your Steam's Internet Protocol; Solution 2. Check Your Internet Connection Works Normally; Solution 3. Reinstall Your Steam ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found