Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

keep old connection file. DO NOT CROSS BRANCHES AGAIN

  • Loading branch information...
commit 56fd098ee2f21631b42725283d0fbb43793cb52d 1 parent 37587df
Dario Guzik authored
Showing with 10 additions and 28 deletions.
  1. +10 −28 src/main/java/redis/clients/jedis/Connection.java
View
38 src/main/java/redis/clients/jedis/Connection.java
@@ -61,24 +61,6 @@ protected void flush() {
}
}
- protected Object read() {
- try {
- return protocol.read(inputStream);
- } catch (JedisConnectionException e) {
- disconnect();
- throw new JedisConnectionException(e);
- }
- }
-
- protected void sendProtocolCommand(final Command cmd, final byte[]... args) {
- try {
- protocol.sendCommand(outputStream, cmd, args);
- } catch (JedisConnectionException e) {
- disconnect();
- throw new JedisConnectionException(e);
- }
- }
-
protected Connection sendCommand(final Command cmd, final String... args) {
final byte[][] bargs = new byte[args.length][];
for (int i = 0; i < args.length; i++) {
@@ -89,14 +71,14 @@ protected Connection sendCommand(final Command cmd, final String... args) {
protected Connection sendCommand(final Command cmd, final byte[]... args) {
connect();
- sendProtocolCommand(cmd, args);
+ protocol.sendCommand(outputStream, cmd, args);
pipelinedCommands++;
return this;
}
protected Connection sendCommand(final Command cmd) {
connect();
- sendProtocolCommand(cmd, new byte[0][]);
+ protocol.sendCommand(outputStream, cmd, new byte[0][]);
pipelinedCommands++;
return this;
}
@@ -163,7 +145,7 @@ public boolean isConnected() {
protected String getStatusCodeReply() {
flush();
pipelinedCommands--;
- final byte[] resp = (byte[]) read();
+ final byte[] resp = (byte[]) protocol.read(inputStream);
if (null == resp) {
return null;
} else {
@@ -183,13 +165,13 @@ public String getBulkReply() {
public byte[] getBinaryBulkReply() {
flush();
pipelinedCommands--;
- return (byte[]) read();
+ return (byte[]) protocol.read(inputStream);
}
public Long getIntegerReply() {
flush();
pipelinedCommands--;
- return (Long) read();
+ return (Long) protocol.read(inputStream);
}
public List<String> getMultiBulkReply() {
@@ -200,14 +182,14 @@ public Long getIntegerReply() {
public List<byte[]> getBinaryMultiBulkReply() {
flush();
pipelinedCommands--;
- return (List<byte[]>) read();
+ return (List<byte[]>) protocol.read(inputStream);
}
@SuppressWarnings("unchecked")
public List<Object> getObjectMultiBulkReply() {
flush();
pipelinedCommands--;
- return (List<Object>) read();
+ return (List<Object>) protocol.read(inputStream);
}
public List<Object> getAll() {
@@ -218,7 +200,7 @@ public Long getIntegerReply() {
List<Object> all = new ArrayList<Object>();
flush();
while (pipelinedCommands > except) {
- all.add(read());
+ all.add(protocol.read(inputStream));
pipelinedCommands--;
}
return all;
@@ -227,6 +209,6 @@ public Long getIntegerReply() {
public Object getOne() {
flush();
pipelinedCommands--;
- return read();
+ return protocol.read(inputStream);
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.