diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-09-07 14:34:58 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-09-08 22:54:18 +0200 |
commit | 8adf715f7cd259c1b27a6125720e88b2e765863f (patch) | |
tree | b7968ab440050631aa4949c7b3d4dc084e7ecf12 /src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | |
parent | 299e4bb9ff1994fedd37cb16667f04c1bca50fd4 (diff) |
be a bit more careful when deleting and deactivating accounts
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp/XmppConnection.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index d1012c761..a3323951a 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1394,8 +1394,10 @@ public class XmppConnection implements Runnable { try { socket.close(); } catch (IOException e) { - e.printStackTrace(); + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": io exception "+e.getMessage()+" during force close"); } + } else { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": socket was null during force close"); } } @@ -1420,7 +1422,11 @@ public class XmppConnection implements Runnable { Log.d(Config.LOGTAG, account.getJid().toBareJid()+": waiting for tag writer to finish"); warned = true; } - Thread.sleep(200); + try { + Thread.sleep(200); + } catch(InterruptedException e) { + Log.d(Config.LOGTAG,account.getJid().toBareJid()+": sleep interrupted"); + } i++; } if (warned) { @@ -1430,8 +1436,8 @@ public class XmppConnection implements Runnable { tagWriter.writeTag(Tag.end("stream:stream")); } catch (final IOException e) { Log.d(Config.LOGTAG,account.getJid().toBareJid()+": io exception during disconnect ("+e.getMessage()+")"); - } catch (final InterruptedException e) { - Log.d(Config.LOGTAG, "interrupted"); + } finally { + forceCloseSocket(); } } } |