mirror of
https://github.com/moparisthebest/Conversations
synced 2024-12-01 05:02:21 -05:00
use a 20s timeout on socks5 connections
This commit is contained in:
parent
fbc43a8d38
commit
1446a59fa5
@ -11,6 +11,7 @@ public final class Config {
|
|||||||
public static final int PING_MAX_INTERVAL = 300;
|
public static final int PING_MAX_INTERVAL = 300;
|
||||||
public static final int PING_MIN_INTERVAL = 30;
|
public static final int PING_MIN_INTERVAL = 30;
|
||||||
public static final int PING_TIMEOUT = 10;
|
public static final int PING_TIMEOUT = 10;
|
||||||
|
public static final int SOCKET_TIMEOUT = 20;
|
||||||
public static final int CONNECT_TIMEOUT = 90;
|
public static final int CONNECT_TIMEOUT = 90;
|
||||||
public static final int CARBON_GRACE_PERIOD = 60;
|
public static final int CARBON_GRACE_PERIOD = 60;
|
||||||
public static final int MINI_GRACE_PERIOD = 750;
|
public static final int MINI_GRACE_PERIOD = 750;
|
||||||
|
@ -6,7 +6,9 @@ import java.io.FileNotFoundException;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
import java.net.SocketAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.security.NoSuchAlgorithmException;
|
import java.security.NoSuchAlgorithmException;
|
||||||
@ -56,8 +58,9 @@ public class JingleSocks5Transport extends JingleTransport {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
socket = new Socket(candidate.getHost(),
|
socket = new Socket();
|
||||||
candidate.getPort());
|
SocketAddress address = new InetSocketAddress(candidate.getHost(),candidate.getPort());
|
||||||
|
socket.connect(address,Config.SOCKET_TIMEOUT * 1000);
|
||||||
inputStream = socket.getInputStream();
|
inputStream = socket.getInputStream();
|
||||||
outputStream = socket.getOutputStream();
|
outputStream = socket.getOutputStream();
|
||||||
byte[] login = { 0x05, 0x01, 0x00 };
|
byte[] login = { 0x05, 0x01, 0x00 };
|
||||||
|
Loading…
Reference in New Issue
Block a user