Fixing setting of socket timeout in HTTPS connections

This commit is contained in:
David A. Velasco 2012-08-17 14:28:46 +02:00
parent b5e8b4bde5
commit 1b2a3581ff

View file

@ -179,13 +179,13 @@ public class EasySSLSocketFactory implements ProtocolSocketFactory {
}
int timeout = params.getConnectionTimeout();
SocketFactory socketfactory = getSSLContext().getSocketFactory();
if (timeout == 0) {
/*if (timeout == 0) {
Log.d(TAG, " ... with connection timeout 0 and socket timeout " + params.getSoTimeout());
Socket socket = socketfactory.createSocket(host, port, localAddress,
localPort);
socket.setSoTimeout(params.getSoTimeout());
return socket;
} else {
} else {*/
Log.d(TAG, " ... with connection timeout " + timeout + " and socket timeout " + params.getSoTimeout());
Socket socket = socketfactory.createSocket();
SocketAddress localaddr = new InetSocketAddress(localAddress,
@ -195,7 +195,7 @@ public class EasySSLSocketFactory implements ProtocolSocketFactory {
socket.bind(localaddr);
socket.connect(remoteaddr, timeout);
return socket;
}
//}
}
/**