コード例 #1
0
 @Override
 public void awaitWritable() throws IOException {
   Integer timeout = connection.getOption(Options.WRITE_TIMEOUT);
   if (timeout != null && timeout > 0) {
     super.awaitWritable(timeout + FUZZ_FACTOR, TimeUnit.MILLISECONDS);
   } else {
     super.awaitWritable();
   }
 }
コード例 #2
0
 @Override
 public void awaitWritable(long time, TimeUnit timeUnit) throws IOException {
   Integer timeout = connection.getOption(Options.WRITE_TIMEOUT);
   if (timeout != null && timeout > 0) {
     long millis = timeUnit.toMillis(time);
     super.awaitWritable(Math.min(millis, timeout + FUZZ_FACTOR), TimeUnit.MILLISECONDS);
   } else {
     super.awaitWritable(time, timeUnit);
   }
 }