diff options
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/ConnectionOut.java')
-rw-r--r-- | src/main/java/com/juick/xmpp/s2s/ConnectionOut.java | 16 |
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); } } } |