Smack disconnect drops messages!

Hi,

I just discovered a rather nasty bug in how Smack handles the disconnect:

I have an automated process that send messages. It does a basic (login ; send message; disconnect) cycle based on some triggers.

It turns out that the disconnect closes the channels without first flushing any pending messages. From the source of XMPPConnection, you can see that it simply waits for 150 millis, and then closes the reader/writer.

The PacketWriter already keep a queue of the messages that need to be send; disconnect() ought to wait until all messages are processed before proceeding with the disconnect.

Any of the Smack developers that can give me any solid workarounds (except for just a Thread.sleep()) ?

Thanks much,

Filip