Connect.connect() now honors timeout value

This commit is contained in:
Mike Hobbs
2011-02-10 10:51:48 -06:00
committed by Jonathan Leibiusky
parent fa05c2e9d0
commit dad1b8c394

View File

@@ -1,6 +1,7 @@
package redis.clients.jedis;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
import java.util.ArrayList;
@@ -102,7 +103,8 @@ public class Connection {
public void connect() {
if (!isConnected()) {
try {
socket = new Socket(host, port);
socket = new Socket();
socket.connect(new InetSocketAddress(host, port), timeout);
socket.setSoTimeout(timeout);
outputStream = new RedisOutputStream(socket.getOutputStream());
inputStream = new RedisInputStream(socket.getInputStream());