From 35f0aa9e4940a7e95509c0745489452784446712 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 25 Mar 2019 13:06:12 +0100 Subject: [PATCH] XMPPTCPConnection log when reader/writer threads start and exit --- .../org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index 97e0e2044a..f9dc64d152 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -1074,16 +1074,19 @@ protected class PacketReader { void init() { done = false; + final String threadName = "Smack Reader (" + getConnectionCounter() + ')'; Async.go(new Runnable() { @Override public void run() { + LOGGER.finer(threadName + " start"); try { parsePackets(); } finally { + LOGGER.finer(threadName + " exit"); XMPPTCPConnection.this.readerWriterSemaphore.release(); } } - }, "Smack Reader (" + getConnectionCounter() + ")"); + }, threadName); } /** @@ -1378,16 +1381,19 @@ void init() { } queue.start(); + final String threadName = "Smack Writer (" + getConnectionCounter() + ')'; Async.go(new Runnable() { @Override public void run() { + LOGGER.finer(threadName + " start"); try { writePackets(); } finally { + LOGGER.finer(threadName + " exit"); XMPPTCPConnection.this.readerWriterSemaphore.release(); } } - }, "Smack Writer (" + getConnectionCounter() + ")"); + }, threadName); } private boolean done() {