예제 #1
0
파일: Connection.java 프로젝트: alfr/jedis
 public void setTimeoutInfinite() {
   try {
     if (!isConnected()) {
       connect();
     }
     socket.setKeepAlive(true);
     socket.setSoTimeout(0);
   } catch (SocketException ex) {
     throw new JedisException(ex);
   }
 }
예제 #2
0
 @Override
 public void connect() {
   if (!isConnected()) {
     super.connect();
     if (password != null) {
       auth(password);
       getStatusCodeReply();
     }
     if (db > 0) {
       select(Long.valueOf(db).intValue());
       getStatusCodeReply();
     }
   }
 }
예제 #3
0
 protected Connection sendCommand(final Command cmd) {
   connect();
   protocol.sendCommand(outputStream, cmd, new byte[0][]);
   pipelinedCommands++;
   return this;
 }
예제 #4
0
 protected Connection sendCommand(final Command cmd, final byte[]... args) {
   connect();
   protocol.sendCommand(outputStream, cmd, args);
   pipelinedCommands++;
   return this;
 }