The server does not always send out a closing stream element if a closing stream element was sent to Openfire by the client.
in NIOConnection#close(), two things are done: first, the session gets closed. Then the String that makes up the closing stream element gets sent. Sadly, the method that is used to deliver that String to the client (NIOConnection#deliverRawText()) returns without doing something if the session is closed - which we just did.
First send out the element, then close the session, instead of the other way around.
In theory, this could keep the connection open long enough for more text to be sent (after the ) before the session gets closed. Is that going to be a problem?
Message was edited by: Guus
I added a JUnit 3.8 Testcase that looks for the desired behavior. The testcase requires Smack.