diff options
author | Christian Schneppe <christian@pix-art.de> | 2019-07-17 20:42:54 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2019-07-17 20:42:54 +0200 |
commit | c88523b1b84e9226e524e8d9b7ef6987118cd2cd (patch) | |
tree | f7bb3006be1122b6ce97f1c3df807e3c2038597c /src/main/java/de/pixart/messenger/xmpp | |
parent | 00334edc6f53cf49298f23b4db87e843d1f56542 (diff) |
use helper method to close socket
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp')
-rw-r--r-- | src/main/java/de/pixart/messenger/xmpp/XmppConnection.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java index 9493b260d..70ae1bc1b 100644 --- a/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java +++ b/src/main/java/de/pixart/messenger/xmpp/XmppConnection.java @@ -1567,15 +1567,8 @@ public class XmppConnection implements Runnable { } private void forceCloseSocket() { - if (socket != null) { - try { - socket.close(); - } catch (Exception e) { - Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": exception " + e.getMessage() + " during force close"); - } - } else { - Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": socket was null during force close"); - } + FileBackend.close(this.socket); + FileBackend.close(this.tagReader); } public void interrupt() { @@ -1586,7 +1579,7 @@ public class XmppConnection implements Runnable { public void disconnect(final boolean force) { interrupt(); - Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": disconnecting force=" + Boolean.toString(force)); + Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": disconnecting force=" + force); if (force) { forceCloseSocket(); } else { |