Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for hasNext (0.17 sec)

  1. okhttp/src/test/java/okhttp3/internal/connection/RouteSelectorTest.kt

        assertThat(routeSelector.hasNext()).isTrue()
        dns[uriHost] = dns.allocate(2)
        val selection = routeSelector.next()
        assertRoute(selection.next(), address, Proxy.NO_PROXY, dns.lookup(uriHost, 0), uriPort)
        assertRoute(selection.next(), address, Proxy.NO_PROXY, dns.lookup(uriHost, 1), uriPort)
        assertThat(selection.hasNext()).isFalse()
        assertThat(routeSelector.hasNext()).isFalse()
        dns.assertRequests(uriHost)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Mar 06 17:33:38 GMT 2024
    - 20.8K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/connection/RealRoutePlanner.kt

        }
    
        // If we have a routes left, use 'em.
        if (routeSelection?.hasNext() == true) return true
    
        // If we haven't initialized the route selector yet, assume it'll have at least one route.
        val localRouteSelector = routeSelector ?: return true
    
        // If we do have a route selector, use its routes.
        return localRouteSelector.hasNext()
      }
    
      /**
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 12K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/connection/RouteSelector.kt

      }
    
      /**
       * Returns true if there's another set of routes to attempt. Every address has at least one route.
       */
      operator fun hasNext(): Boolean = hasNextProxy() || postponedRoutes.isNotEmpty()
    
      @Throws(IOException::class)
      operator fun next(): Selection {
        if (!hasNext()) throw NoSuchElementException()
    
        // Compute the next set of routes to attempt.
        val routes = mutableListOf<Route>()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Mar 06 17:33:38 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

        for (i in 0 until frameCount) {
          if (nextOutFrame == null && outFramesIterator.hasNext()) {
            nextOutFrame = outFramesIterator.next()
          }
    
          if (nextOutFrame != null && nextOutFrame.sequence == i) {
            val start = nextOutFrame.start
            var truncated: Boolean
            var end: Long
            if (outFramesIterator.hasNext()) {
              nextOutFrame = outFramesIterator.next()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.7K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/cache/DiskLruCacheTest.kt

        set("b", "b1", "b2")
        set("c", "c1", "c2")
        val iterator = cache.snapshots()
        assertThat(iterator.hasNext()).isTrue()
        iterator.next().use {
          assertThat(it.key()).isEqualTo("a")
          it.assertValue(0, "a1")
          it.assertValue(1, "a2")
        }
        assertThat(iterator.hasNext()).isTrue()
        iterator.next().use {
          assertThat(it.key()).isEqualTo("b")
          it.assertValue(0, "b1")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 15 14:55:09 GMT 2024
    - 75.8K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/FakeRoutePlanner.kt

          taskFaker.yield()
        }
    
        val planningThrowable = result.planningThrowable
        if (planningThrowable != null) throw planningThrowable
    
        return result
      }
    
      override fun hasNext(failedConnection: RealConnection?): Boolean {
        return deferredPlans.isNotEmpty() || nextPlanIndex < plans.size || autoGeneratePlans
      }
    
      override fun sameHostAndPort(url: HttpUrl): Boolean {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/Cache.kt

          private var nextUrl: String? = null
          private var canRemove = false
    
          override fun hasNext(): Boolean {
            if (nextUrl != null) return true
    
            canRemove = false // Prevent delegate.remove() on the wrong item!
            while (delegate.hasNext()) {
              try {
                delegate.next().use { snapshot ->
                  val metadata = snapshot.getSource(ENTRY_METADATA).buffer()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 26.8K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Dispatcher.kt

        lock.assertNotHeld()
    
        val executableCalls = mutableListOf<AsyncCall>()
        val isRunning: Boolean
        this.withLock {
          val i = readyAsyncCalls.iterator()
          while (i.hasNext()) {
            val asyncCall = i.next()
    
            if (runningAsyncCalls.size >= this.maxRequests) break // Max capacity.
            if (asyncCall.callsPerHost.get() >= this.maxRequestsPerHost) continue // Host max capacity.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 9K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/CacheTest.kt

        val i: Iterator<String> = cache.urls()
        assertThat(i.hasNext()).isTrue()
        assertThat(i.next()).isEqualTo(urlA.toString())
        assertThat(i.hasNext()).isTrue()
        assertThat(i.next()).isEqualTo(urlB.toString())
        assertThat(i.hasNext()).isTrue()
        assertThat(i.next()).isEqualTo(urlC.toString())
    
        // ... and nothing else.
        assertThat(i.hasNext()).isFalse()
        assertFailsWith<NoSuchElementException> {
    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)
  10. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

          serverSocket?.closeQuietly()
    
          val openClientSocket = openClientSockets.iterator()
          while (openClientSocket.hasNext()) {
            openClientSocket.next().closeQuietly()
            openClientSocket.remove()
          }
    
          val httpConnection = openConnections.iterator()
          while (httpConnection.hasNext()) {
            httpConnection.next().closeQuietly()
            httpConnection.remove()
          }
          dispatcher.shutdown()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 37.4K bytes
    - Viewed (0)
Back to top