diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2015-05-18 04:34:34 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2015-05-18 08:46:04 +0200 |
commit | 1446a59fa594be49277d1ec9d7fe023949bcfc55 (patch) | |
tree | 8aebb7a227ef7498d028c53fabbc4157a567ad8b /src/main/java/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java | |
parent | fbc43a8d38e62fc2a3b60e7c363c8fe1e2668cc6 (diff) |
use a 20s timeout on socks5 connections
Diffstat (limited to 'src/main/java/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java index 35375a5dc..8d74f44e3 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java @@ -6,7 +6,9 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.InetSocketAddress; import java.net.Socket; +import java.net.SocketAddress; import java.net.UnknownHostException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; @@ -56,8 +58,9 @@ public class JingleSocks5Transport extends JingleTransport { @Override public void run() { try { - socket = new Socket(candidate.getHost(), - candidate.getPort()); + socket = new Socket(); + SocketAddress address = new InetSocketAddress(candidate.getHost(),candidate.getPort()); + socket.connect(address,Config.SOCKET_TIMEOUT * 1000); inputStream = socket.getInputStream(); outputStream = socket.getOutputStream(); byte[] login = { 0x05, 0x01, 0x00 }; |