Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 31 - 40 of 320 for TimeUnit (0.08 seconds)

  1. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

      @Test
      fun fullCallTimeoutDoesNotApplyOnceConnected() {
        client =
          client
            .newBuilder()
            .callTimeout(250, TimeUnit.MILLISECONDS)
            .build()
        server.enqueue(
          MockResponse
            .Builder()
            .bodyDelay(500, TimeUnit.MILLISECONDS)
            .setHeader("content-type", "text/event-stream")
            .body("data: hey\n\n")
            .build(),
        )
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Nov 04 19:13:52 GMT 2025
    - 8.8K bytes
    - Click Count (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/WholeOperationTimeoutTest.kt

          .isEqualTo(TimeUnit.MILLISECONDS.toNanos(456))
      }
    
      @Test
      fun timeoutWritingRequest() {
        server.enqueue(MockResponse())
        val request =
          Request
            .Builder()
            .url(server.url("/"))
            .post(sleepingRequestBody(500))
            .build()
        val call = client.newCall(request)
        call.timeout().timeout(250, TimeUnit.MILLISECONDS)
        assertFailsWith<IOException> {
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Jun 18 12:28:21 GMT 2025
    - 10.6K bytes
    - Click Count (0)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/-UtilJvm.kt

    @Throws(IOException::class)
    internal fun Source.skipAll(
      duration: Int,
      timeUnit: TimeUnit,
    ): Boolean {
      val nowNs = System.nanoTime()
      val originalDurationNs =
        if (timeout().hasDeadline()) {
          timeout().deadlineNanoTime() - nowNs
        } else {
          Long.MAX_VALUE
        }
      timeout().deadlineNanoTime(nowNs + minOf(originalDurationNs, timeUnit.toNanos(duration.toLong())))
      return try {
        val skipBuffer = Buffer()
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Thu Jul 31 04:18:40 GMT 2025
    - 10.2K bytes
    - Click Count (1)
  4. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockWebServer.kt

     * limitations under the License.
     */
    package okhttp3.mockwebserver
    
    import java.io.Closeable
    import java.io.IOException
    import java.net.InetAddress
    import java.net.Proxy
    import java.util.concurrent.TimeUnit
    import java.util.logging.Level
    import java.util.logging.Logger
    import javax.net.ServerSocketFactory
    import javax.net.ssl.SSLSocketFactory
    import okhttp3.HttpUrl
    import okhttp3.Protocol
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Wed Jun 18 00:19:42 GMT 2025
    - 4.6K bytes
    - Click Count (0)
  5. guava-testlib/src/com/google/common/testing/FakeTicker.java

      private volatile long autoIncrementStepNanos;
    
      /** Advances the ticker value by {@code time} in {@code timeUnit}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long time, TimeUnit timeUnit) {
        return advance(timeUnit.toNanos(time));
      }
    
      /** Advances the ticker value by {@code nanoseconds}. */
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Mon Apr 14 15:16:19 GMT 2025
    - 3.4K bytes
    - Click Count (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt

     * limitations under the License.
     */
    package okhttp3
    
    import java.io.IOException
    import java.net.InetAddress
    import java.net.InetSocketAddress
    import java.net.Proxy
    import java.util.concurrent.TimeUnit
    
    class ClientRuleEventListener(
      var logger: (String) -> Unit,
    ) : EventListener(),
      EventListener.Factory {
      private var startNs: Long? = null
    
      override fun create(call: Call): EventListener = this
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Tue Oct 07 21:03:04 GMT 2025
    - 5.4K bytes
    - Click Count (0)
  7. guava-testlib/test/com/google/common/testing/FakeTickerTest.java

        assertEquals(0, ticker.read());
        assertEquals(10, ticker.read());
        assertEquals(20, ticker.read());
    
        for (TimeUnit timeUnit : TimeUnit.values()) {
          ticker.setAutoIncrementStep(0, timeUnit);
          assertEquals(
              "Expected no auto-increment when setting autoIncrementStep to 0 " + timeUnit,
              30,
              ticker.read());
        }
      }
    
      public void testAutoIncrement_negative() {
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Aug 07 16:05:33 GMT 2025
    - 6.3K bytes
    - Click Count (0)
  8. android/guava-testlib/src/com/google/common/testing/FakeTicker.java

      private volatile long autoIncrementStepNanos;
    
      /** Advances the ticker value by {@code time} in {@code timeUnit}. */
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      @CanIgnoreReturnValue
      public FakeTicker advance(long time, TimeUnit timeUnit) {
        return advance(timeUnit.toNanos(time));
      }
    
      /** Advances the ticker value by {@code nanoseconds}. */
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Mon Apr 14 15:16:19 GMT 2025
    - 4.1K bytes
    - Click Count (0)
  9. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

      private var throttlePeriodUnit = TimeUnit.SECONDS
    
      @set:JvmName("socketPolicy")
      var socketPolicy: SocketPolicy = SocketPolicy.KEEP_OPEN
    
      @set:JvmName("http2ErrorCode")
      var http2ErrorCode: Int = -1
    
      private var bodyDelayAmount = 0L
      private var bodyDelayUnit = TimeUnit.MILLISECONDS
    
      private var headersDelayAmount = 0L
      private var headersDelayUnit = TimeUnit.MILLISECONDS
    
    Created: Fri Dec 26 11:42:13 GMT 2025
    - Last Modified: Sat May 10 11:15:14 GMT 2025
    - 7.1K bytes
    - Click Count (1)
  10. android/guava-testlib/src/com/google/common/util/concurrent/testing/SameThreadScheduledExecutorService.java

        Preconditions.checkNotNull(command, "command must not be null");
        Preconditions.checkNotNull(unit, "unit must not be null!");
        return schedule(callable(command), delay, unit);
      }
    
      @Override
      public <V> ListenableScheduledFuture<V> schedule(
          Callable<V> callable, long delay, TimeUnit unit) {
    Created: Fri Dec 26 12:43:10 GMT 2025
    - Last Modified: Thu Aug 07 16:37:28 GMT 2025
    - 6.5K bytes
    - Click Count (0)
Back to Top