diff options
author | Vitaly Takmazov | 2016-07-07 14:03:10 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-07-07 14:03:10 +0300 |
commit | 7f6c01a9435fdaf35c804b97faca01242b439e70 (patch) | |
tree | f1dda5a80d1d61f56060b2f23c7c9c6a33d9491d /src/main/java/com/juick/xmpp/s2s/ConnectionOut.java | |
parent | 93cab67688630bbc4f6ace3c23d272828c2e47b3 (diff) |
refactor
Diffstat (limited to 'src/main/java/com/juick/xmpp/s2s/ConnectionOut.java')
-rw-r--r-- | src/main/java/com/juick/xmpp/s2s/ConnectionOut.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java index fede701e..cf54997f 100644 --- a/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java +++ b/src/main/java/com/juick/xmpp/s2s/ConnectionOut.java @@ -10,6 +10,7 @@ import javax.net.ssl.SSLSocket; import java.io.EOFException; import java.io.IOException; import java.net.InetAddress; +import java.net.InetSocketAddress; import java.net.Socket; import java.net.UnknownHostException; import java.security.KeyManagementException; @@ -61,12 +62,8 @@ public class ConnectionOut extends Connection implements Runnable { public void run() { LOGGER.info("STREAM TO " + to + " START"); try { - HostnamePort addr = DNSQueries.getServerAddress(to); - try { - socket = new Socket(InetAddress.getByName(addr.hostname), addr.port); - } catch (UnknownHostException e) { - socket = new Socket(InetAddress.getByName("talk.google.com"), 5269); - } + socket = new Socket(); + socket.connect(DNSQueries.getServerAddress(to)); restartParser(); sendOpenStream(); |