Fixed infinite timeout handling. Increased code reuse so that there will be fewer copy and paste errors.
This commit is contained in:
@@ -42,7 +42,6 @@ public class Connection implements Closeable {
|
||||
if (!isConnected()) {
|
||||
connect();
|
||||
}
|
||||
socket.setKeepAlive(true);
|
||||
socket.setSoTimeout(0);
|
||||
} catch (SocketException ex) {
|
||||
broken = true;
|
||||
@@ -53,7 +52,6 @@ public class Connection implements Closeable {
|
||||
public void rollbackTimeout() {
|
||||
try {
|
||||
socket.setSoTimeout(timeout);
|
||||
socket.setKeepAlive(false);
|
||||
} catch (SocketException ex) {
|
||||
broken = true;
|
||||
throw new JedisConnectionException(ex);
|
||||
|
||||
Reference in New Issue
Block a user