aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/juick/xmpp/s2s/ConnectionOut.java23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
index 5ef5fd3c..a80e88ff 100644
--- a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
+++ b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java
@@ -2,26 +2,17 @@ package com.juick.xmpp.s2s;
import com.juick.xmpp.extensions.StreamFeatures;
import com.juick.xmpp.utils.XmlUtils;
+import org.xmlpull.v1.XmlPullParser;
+import javax.net.ssl.SSLException;
+import javax.net.ssl.SSLSocket;
import java.io.EOFException;
import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
import java.net.InetAddress;
-import java.net.InetSocketAddress;
import java.net.Socket;
-import java.nio.channels.AsynchronousSocketChannel;
-import java.nio.channels.Channels;
-import java.nio.channels.CompletionHandler;
-import java.util.concurrent.ExecutionException;
+import java.net.UnknownHostException;
import java.util.logging.Level;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-import javax.net.ssl.SSLException;
-import javax.net.ssl.SSLSocket;
-
/**
* @author ugnich
*/
@@ -63,7 +54,11 @@ public class ConnectionOut extends Connection implements Runnable {
LOGGER.info("STREAM TO " + to + " START");
try {
HostnamePort addr = DNSQueries.getServerAddress(to);
- socket = new Socket(InetAddress.getByName(addr.hostname), addr.port);
+ try {
+ socket = new Socket(InetAddress.getByName(addr.hostname), addr.port);
+ } catch (UnknownHostException e) {
+ socket = new Socket(InetAddress.getByName("talk.google.com"), 5269);
+ }
restartParser();
sendOpenStream();