Merge branch 'master' into #66_remove_loggers_and_recorders_between_channel_restarts

This commit is contained in:
Denny
2017-01-08 04:44:53 -05:00
3 changed files with 36 additions and 9 deletions

View File

@@ -242,12 +242,21 @@ public class IcecastTCPAudioBroadcaster extends IcecastAudioBroadcaster
public void exceptionCaught(IoSession session, Throwable cause) throws Exception public void exceptionCaught(IoSession session, Throwable cause) throws Exception
{ {
if(cause instanceof IOException && ((IOException)cause).getMessage().startsWith("Connection reset")) if(cause instanceof IOException && ((IOException)cause).getMessage().startsWith("Connection reset"))
{
IOException ioe = (IOException)cause;
if(ioe.getMessage() != null && ioe.getMessage().startsWith("Connection reset"))
{ {
mLog.info("Streaming connection reset by remote server - reestablishing connection"); mLog.info("Streaming connection reset by remote server - reestablishing connection");
disconnect(); disconnect();
connect(); connect();
} }
else else
{
mLog.error("IO Exception", ioe);
}
}
else
{ {
mLog.error("Broadcast error", cause); mLog.error("Broadcast error", cause);
setBroadcastState(BroadcastState.ERROR); setBroadcastState(BroadcastState.ERROR);

View File

@@ -243,12 +243,21 @@ public class ShoutcastV1AudioBroadcaster extends AudioBroadcaster
public void exceptionCaught(IoSession session, Throwable cause) throws Exception public void exceptionCaught(IoSession session, Throwable cause) throws Exception
{ {
if(cause instanceof IOException && ((IOException)cause).getMessage().startsWith("Connection reset")) if(cause instanceof IOException && ((IOException)cause).getMessage().startsWith("Connection reset"))
{
IOException ioe = (IOException)cause;
if(ioe.getMessage() != null && ioe.getMessage().startsWith("Connection reset"))
{ {
mLog.info("Streaming connection reset by remote server - reestablishing connection"); mLog.info("Streaming connection reset by remote server - reestablishing connection");
disconnect(); disconnect();
connect(); connect();
} }
else else
{
mLog.error("IO Exception", ioe);
}
}
else
{ {
mLog.error("Broadcast error", cause); mLog.error("Broadcast error", cause);
setBroadcastState(BroadcastState.ERROR); setBroadcastState(BroadcastState.ERROR);

View File

@@ -369,12 +369,21 @@ public class ShoutcastV2AudioBroadcaster extends AudioBroadcaster implements IBr
public void exceptionCaught(IoSession session, Throwable cause) throws Exception public void exceptionCaught(IoSession session, Throwable cause) throws Exception
{ {
if(cause instanceof IOException && ((IOException)cause).getMessage().startsWith("Connection reset")) if(cause instanceof IOException && ((IOException)cause).getMessage().startsWith("Connection reset"))
{
IOException ioe = (IOException)cause;
if(ioe.getMessage() != null && ioe.getMessage().startsWith("Connection reset"))
{ {
mLog.info("Streaming connection reset by remote server - reestablishing connection"); mLog.info("Streaming connection reset by remote server - reestablishing connection");
disconnect(); disconnect();
connect(); connect();
} }
else else
{
mLog.error("IO Exception", ioe);
}
}
else
{ {
mLog.error("Broadcast error", cause); mLog.error("Broadcast error", cause);
setBroadcastState(BroadcastState.ERROR); setBroadcastState(BroadcastState.ERROR);