コード例 #1
0
 private void checkWriteTimeout(final boolean xfer) throws WriteTimeoutException {
   int timeout = writeTimeout;
   if (timeout > 0) {
     if (xfer) {
       lastWrite = System.nanoTime();
     } else {
       long lastWrite = this.lastWrite;
       if (lastWrite > 0L && ((System.nanoTime() - lastWrite) / 1000000L) > (long) timeout) {
         throw log.writeTimeout();
       }
     }
   }
 }
コード例 #2
0
 private void checkReadTimeout(final boolean xfer) throws ReadTimeoutException {
   int timeout = readTimeout;
   if (timeout > 0) {
     if (xfer) {
       lastRead = System.nanoTime();
     } else {
       long lastRead = this.lastRead;
       if (lastRead > 0L && ((System.nanoTime() - lastRead) / 1000000L) > (long) timeout) {
         throw log.readTimeout();
       }
     }
   }
 }