1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 09:09:38 +02:00

Notify packet sending listeners in new thread

sendListeners are now invoked *after* the packet has been put on the
wire.

Also sending listener exceptions are not catched and not only
NotConnectedExceptions. And a exception does not cause a 'break' but a
'continue' now. Log level is WARNING now.
This commit is contained in:
Florian Schmaus 2014-10-25 11:39:16 +02:00
parent 51d84647f3
commit 9f56842ee4
3 changed files with 57 additions and 35 deletions

View file

@ -309,6 +309,9 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
private void sendElement(Element element) {
try {
send(ComposableBody.builder().setPayloadXML(element.toXML().toString()).build());
if (element instanceof Packet) {
firePacketSendingListeners((Packet) element);
}
}
catch (BOSHException e) {
LOGGER.log(Level.SEVERE, "BOSHException in sendPacketInternal", e);