kiall / android-tvheadend

Android + TV Headend + TV Input Framework
Apache License 2.0
191 stars 61 forks source link

Live Channels freeze when incorrect port is entered #210

Closed girlpunk closed 6 years ago

girlpunk commented 6 years ago

When setting up an account/server, if an incorrect port is entered where there is no service listening on that port, the setup gets stuck on the "Enter your Tvheadend username and password" page with all options greyed out. After a few minutes, a "Live Channels has stopped responding" dialogue shows up.

I/HtspConnection: Opening HTSP Connection
E/HtspConnection: Failed to connect to HTSP server address:
                  java.net.ConnectException: failed to connect to tvstreaming/172.16.42.42 (port 889): isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:234)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277)
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284)
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221)
                      at java.lang.Thread.run(Thread.java:818)
                   Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:223)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277) 
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284) 
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221) 
                      at java.lang.Thread.run(Thread.java:818) 
I/HtspConnection: Closing HTSP Connection
W/SimpleHtspConnection: HTSP Connection failed, reconnecting in 0 milliseconds
W/HtspConnection: Attempting to close while already closed, closing or failed
W/ie.macinnes.tvheadend.account.AuthenticatorActivity: Failed to connect to HTSP server
I/HtspConnection: Opening HTSP Connection
E/HtspConnection: HTSP Connection thread wrapping up without already being closed
I/HtspConnection: Closing HTSP Connection
W/SimpleHtspConnection: HTSP Connection failed, reconnecting in 100 milliseconds
E/HtspConnection: Something failed - shutting down
                  java.nio.channels.AsynchronousCloseException
                      at java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:116)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:285)
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284)
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221)
                      at java.lang.Thread.run(Thread.java:818)
W/HtspConnection: Attempting to close while already closed, closing or failed
W/HtspConnection: Attempting to close while already closed, closing or failed
W/HtspConnection: Attempting to close while already closed, closing or failed
I/art: Thread[2,tid=11615,WaitingInMainSignalCatcherLoop,Thread*=0xebac7000,peer=0x12c820a0,"Signal Catcher"]: reacting to signal 3
I/art: Wrote stack traces to '/data/anr/traces.txt'
girlpunk commented 6 years ago

hmm, I can't replicate this now. Just goes to the failed screen as expected. For reference, here's the logs when that happens:

I/HtspConnection: Opening HTSP Connection
E/HtspConnection: Failed to connect to HTSP server address:
                  java.net.ConnectException: failed to connect to tvstreaming/172.16.42.42 (port 8891): isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:234)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277)
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284)
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221)
                      at java.lang.Thread.run(Thread.java:818)
                   Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:223)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277) 
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284) 
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221) 
                      at java.lang.Thread.run(Thread.java:818) 
I/HtspConnection: Closing HTSP Connection
W/SimpleHtspConnection: HTSP Connection failed, reconnecting in 0 milliseconds
W/HtspConnection: Attempting to close while already closed, closing or failed
W/ie.macinnes.tvheadend.account.AuthenticatorActivity: Failed to connect to HTSP server
I/HtspConnection: Opening HTSP Connection
E/HtspConnection: HTSP Connection thread wrapped up upon failure
E/HtspConnection: Failed to connect to HTSP server address:
                  java.net.ConnectException: failed to connect to tvstreaming/172.16.42.42 (port 8891): isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:234)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277)
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284)
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221)
                      at java.lang.Thread.run(Thread.java:818)
                   Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:223)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277) 
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284) 
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221) 
                      at java.lang.Thread.run(Thread.java:818) 
I/HtspConnection: Closing HTSP Connection
W/SimpleHtspConnection: HTSP Connection failed, reconnecting in 100 milliseconds
W/HtspConnection: Attempting to close while already closed, closing or failed
W/HtspConnection: Attempting to close while already closed, closing or failed
W/ie.macinnes.tvheadend.account.AuthenticatorActivity: Failed to connect to HTSP server
E/HtspConnection: HTSP Connection thread wrapped up upon failure
I/HtspConnection: Opening HTSP Connection
E/HtspConnection: Failed to connect to HTSP server address:
                  java.net.ConnectException: failed to connect to tvstreaming/172.16.42.42 (port 8891): isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:234)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277)
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284)
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221)
                      at java.lang.Thread.run(Thread.java:818)
                   Caused by: android.system.ErrnoException: isConnected failed: ECONNREFUSED (Connection refused)
                      at libcore.io.IoBridge.isConnected(IoBridge.java:223)
                      at java.nio.SocketChannelImpl.finishConnect(SocketChannelImpl.java:277) 
                      at ie.macinnes.htsp.HtspConnection.processConnectableSelectionKey(HtspConnection.java:284) 
                      at ie.macinnes.htsp.HtspConnection.run(HtspConnection.java:221) 
                      at java.lang.Thread.run(Thread.java:818) 
I/HtspConnection: Closing HTSP Connection
E/HtspConnection: HTSP Connection thread wrapped up upon failure
kiall commented 6 years ago

I can't replicate this either, reopen if you manage to!