aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-02-01 19:48:21 +0300
committerGravatar Vitaly Takmazov2016-02-01 19:48:21 +0300
commita9a7dd2da8db472e20c3aa44ae7cac274b8ed499 (patch)
tree76791098b26e0bd77b08e9f9b586e77e8c8c896c /src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
parent14c5ddd69a6f76a96d7eb98afb01caac79308553 (diff)
refactoring
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/ConnectionOut.java')
-rw-r--r--src/main/java/com/juick/xmpp/s2s/ConnectionOut.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
index 9a8dd0a8..c18ae342 100644
--- a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
+++ b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
@@ -9,6 +9,7 @@ import java.net.Socket;
import java.nio.channels.AsynchronousSocketChannel;
import java.nio.channels.Channels;
import java.nio.channels.CompletionHandler;
+import java.util.logging.Level;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
@@ -112,21 +113,20 @@ public class ConnectionOut extends Connection implements Runnable {
LOGGER.warning("STREAM TO " + to + " " + streamID + " FINISHED");
XMPPComponent.removeConnectionOut(ConnectionOut.this);
closeConnection();
- } catch (XmlPullParserException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
} catch (Exception e) {
- e.printStackTrace();
+ LOGGER.log(Level.SEVERE, "s2s out exception", e);
+ XMPPComponent.removeConnectionOut(ConnectionOut.this);
+ closeConnection();
}
}
@Override
public void failed(Throwable exc, AsynchronousSocketChannel attachment) {
-
+ LOGGER.log(Level.WARNING, "s2s out failed", exc);
+ XMPPComponent.removeConnectionOut(ConnectionOut.this);
+ closeConnection();
}
});
- Thread.currentThread().join();
} catch (Exception e) {
LOGGER.warning(e.toString());
XMPPComponent.removeConnectionOut(this);
@@ -138,7 +138,7 @@ public class ConnectionOut extends Connection implements Runnable {
try {
sendStanza("<db:verify from='" + XMPPComponent.HOSTNAME + "' to='" + to + "' id='" + sid + "'>" + key + "</db:verify>");
} catch (IOException e) {
- LOGGER.warning("STREAM TO " + to + " " + streamID + " ERROR: " + e.toString());
+ LOGGER.log(Level.WARNING, "STREAM TO " + to + " " + streamID + " ERROR", e);
}
}
}