Verify if there were packets pending to be sent and decide what to do with them


Looks like someone was already planning this. Todo in the source:

There are ideas that this should help with messages being discarded while clients lose their connection.

This ticket needs better name and description.




Tom Evans
April 26, 2014, 9:00 PM

Explicitly check the underlying connection and throw an IOException if the peer has dropped/reset the connection.

Tom Evans
April 26, 2014, 8:34 PM

Since we are using an asynchronous messaging model (via NIO), it makes sense to check whether the peer is still connected before attempting to send a packet. It appears this is what the underlying Mina implementation does, but because the NIOConnector does not wait to check the resulting WriteFuture instance, the backupDeliverer is not invoked (the IOException is effectively suppressed in another thread).

I can make the corresponding change, but note that this is a critical component of the Openfire engine and we will want to test thoroughly.

Daryl Herzmann
April 26, 2014, 6:59 PM

Hi Tom, You have any thoughts on this issue?

Haohuan Li
March 22, 2013, 9:53 AM

I just looked into OpenFire source code v3.8.1. I found that the cause of the issue lies in the MINA lib that was reused by OpenFire. In, line 263:

If the receiver is offline(while the server still assumes he is online), the code:


should have thrown an exception. But actually, no exception is thrown. The variable ioSession is an instance of class: org.apache.mina.common.IoSession, which is a component of Apache MINA project. Maybe this issue should be reported upwards to MINA project.

Your pinned fields
Click on the next to a field label to start pinning.


Tom Evans