Hi there,
This is all part of the socket exception handling and is used to notify the conection and also the reconnectionManager (if allowed) that an exception has occured on Read (or write in packetWriter)
One great thing to do to understand this would be to see where notifyConnectionError is called from.
As you say it's called from PacketReader (I have smack 3.3.0 at the moment accessible to me, could be different in 3.2.1)
So when there is an exception on packet read or write, it is caught in those classes and passes to Connection.notifyConnectionError() which shutsdown the connection and let's the listeners know about the particular error.... and if reconnection is allowed an attempt will be made.
Make sense?
So this exception is caught already in PacketReader.parsePackets() it's just passed to other methods to let other classes know there's been an unexpected disconnect.
From PacketReader.parsePackets()
........
} catch (Exception e) {
// The exception can be ignored if the the connection is 'done'
// or if the it was caused because the socket got closed
if (!(done || connection.isSocketClosed())) {
// Close the connection and notify connection listeners of the
// error.
connection.notifyConnectionError(e);
}
}
..........
James