McsInputStream: terminate if error occurred

This terminates the input stream when an error occurred and does not
wait for the handler thread in the McsService to send the interrupt
signal.

This hopefully fixes a situation that I had where tear down messages
were created in a busy loop because of repeatedly reading -1 from the
input (I don't know how it got into the situation as the log was filled
with the messages from the tear down).
This commit is contained in:
Michael Hamann 2016-01-17 15:44:00 +01:00
parent affce9dc23
commit 3636f18d84
1 changed files with 1 additions and 0 deletions

View File

@ -77,6 +77,7 @@ public class McsInputStream extends Thread {
mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_INPUT, msg));
} else {
mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_TEARDOWN, "null message"));
break; // if input is empty, do not continue looping
}
}
} catch (IOException e) {