Connect.connect() now honors timeout value
This commit is contained in:
committed by
Jonathan Leibiusky
parent
fa05c2e9d0
commit
dad1b8c394
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user