Fixed infinite timeout handling. Increased code reuse so that there will be fewer copy and paste errors.

This commit is contained in:
rdifalco
2014-10-18 12:22:07 -07:00
parent 7845dc350a
commit 8f4dbaf89f
5 changed files with 190 additions and 229 deletions

View File

@@ -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);