Reputation: 7519
I'm trying to use an implementation of an MQTT client specifically Paho Java client in Android, and trying to trace where I get an EOFException error.
Specifically this happens on in.readByte();
.
public final byte readByte() throws IOException {
int temp = in.read();
if (temp < 0) {
throw new EOFException();
}
return (byte) temp;
}
Having looked at this exception, it seems to be triggered when I'm attempting to read from a socket that has been closed. This seems to be a network error, that I fail to locate.
My question is what could cause a socket to close? I haven't yet ruled out the chance of it being closed programmatically but in case of an external factor what are the usual causes of a TCP socket closing? Perhaps any more specific reason relating to an Android device?
Upvotes: 2
Views: 1666
Reputation: 8928
Typically the things that cause a socket to close are:
Without more details on your specific symptoms, it's hard to say which of these is most likely.
Upvotes: 2