I wrote a socket server and I'm running every connection in a thread. This loop is waiting for incoming Data:
public void run() {
BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
try {
while (isPlugged) {
incomingXML = in.readLine();
if (incomingXML != null) {
if (incomingXML.length() > 1) {
parseXML(incomingXML);
}
} else {
break;
}
}
} catch (IOException e) {
logger.logError("Error",e); // for Logfile
} finally {
unplug(); // abort connection
}
}
Sometimes I get a java.net.SocketException: Software caused connection abort: recv failed.
Why do I get this exception? The strange thing is, that it appears just from time to time.