skip initial socket closing if thread was already interrupted

This commit is contained in:
Daniel Gultsch 2017-07-21 08:30:16 +02:00
parent 74cde1d60a
commit 2fc216bfc4

View file

@ -495,7 +495,13 @@ public class XmppConnection implements Runnable {
@Override
public void run() {
forceCloseSocket();
synchronized (this) {
if (Thread.currentThread().isInterrupted()) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": aborting connect because thread was interrupted");
return;
}
forceCloseSocket();
}
connect();
}