Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for toMillis (0.2 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/cache/CacheStrategy.kt

          if (requestCaching.maxAgeSeconds != -1) {
            freshMillis = minOf(freshMillis, SECONDS.toMillis(requestCaching.maxAgeSeconds.toLong()))
          }
    
          var minFreshMillis: Long = 0
          if (requestCaching.minFreshSeconds != -1) {
            minFreshMillis = SECONDS.toMillis(requestCaching.minFreshSeconds.toLong())
          }
    
          var maxStaleMillis: Long = 0
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 13:24:48 GMT 2024
    - 12K bytes
    - Viewed (0)
  2. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/HttpLoggingInterceptor.kt

          try {
            response = chain.proceed(request)
          } catch (e: Exception) {
            logger.log("<-- HTTP FAILED: $e")
            throw e
          }
    
          val tookMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs)
    
          val responseBody = response.body!!
          val contentLength = responseBody.contentLength()
          val bodySize = if (contentLength != -1L) "$contentLength-byte" else "unknown-length"
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 09:14:38 GMT 2024
    - 11.2K bytes
    - Viewed (1)
  3. okhttp-logging-interceptor/src/main/kotlin/okhttp3/logging/LoggingEventListener.kt

        call: Call,
        cachedResponse: Response,
      ) {
        logWithTime("cacheConditionalHit: $cachedResponse")
      }
    
      private fun logWithTime(message: String) {
        val timeMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNs)
        logger.log("[$timeMs ms] $message")
      }
    
      open class Factory
        @JvmOverloads
        constructor(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 01 11:07:32 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

        val startNanos = System.nanoTime()
        while (webSocket.receivedPongCount() < 3) {
          Thread.sleep(50)
        }
        val elapsedUntilPong3 = System.nanoTime() - startNanos
        assertThat(TimeUnit.NANOSECONDS.toMillis(elapsedUntilPong3).toDouble())
          .isCloseTo(1500.0, 250.0)
    
        // The client pinged the server 3 times, and it has ponged back 3 times.
        assertThat(webSocket.sentPingCount()).isEqualTo(3)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 35.2K bytes
    - Viewed (1)
  5. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

         * The default value is 0 which imposes no timeout.
         */
        @SuppressLint("NewApi")
        @IgnoreJRERequirement
        fun callTimeout(duration: Duration) =
          apply {
            callTimeout(duration.toMillis(), MILLISECONDS)
          }
    
        /**
         * Sets the default timeout for complete calls. A value of 0 means no timeout, otherwise values
         * must be between 1 and [Integer.MAX_VALUE] when converted to milliseconds.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:21:33 GMT 2024
    - 52K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/internal/http2/Http2ConnectionTest.kt

          stream.takeHeaders()
        }
        val elapsedNanos = System.nanoTime() - startNanos
        awaitWatchdogIdle()
        // 200ms delta
        assertThat(TimeUnit.NANOSECONDS.toMillis(elapsedNanos).toDouble())
          .isCloseTo(500.0, 200.0)
        assertThat(connection.openStreamCount()).isEqualTo(0)
    
        // Verify the peer received what was expected.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 75.4K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/http2/HttpOverHttp2Test.kt

          assertThat(expected.message).isEqualTo(
            "stream was reset: PROTOCOL_ERROR",
          )
        }
        val elapsedUntilFailure = System.nanoTime() - executeAtNanos
        assertThat(TimeUnit.NANOSECONDS.toMillis(elapsedUntilFailure).toDouble())
          .isCloseTo(1000.0, 250.0)
    
        // Confirm a single ping was sent but not acknowledged.
        val logs = testLogHandler.takeAll()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 75.3K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/CacheTest.kt

      fun retainServedDateFormat() {
        // Serve a response with a non-standard date format that OkHttp supports.
        val lastModifiedDate = Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(-1))
        val servedDate = Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(-2))
        val dateFormat: DateFormat = SimpleDateFormat("EEE dd-MMM-yyyy HH:mm:ss z", Locale.US)
        dateFormat.timeZone = TimeZone.getTimeZone("America/New_York")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/CallTest.kt

            bodySource.readByte()
          }.also { expected ->
            // Timed out as expected.
            val elapsedNanos = System.nanoTime() - startNanos
            val elapsedMillis = TimeUnit.NANOSECONDS.toMillis(elapsedNanos)
            assertThat(elapsedMillis).isLessThan(500)
          }
        }
      }
    
      /** https://github.com/square/okhttp/issues/442  */
      @Test
      fun tlsTimeoutsNotRetried() {
        enableTls()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 142.5K bytes
    - Viewed (0)
Back to top