Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for Every (0.25 sec)

  1. mockwebserver/README.md

    3. Verify that the expected requests were made.
    
    Here's a complete example:
    
    ```java
    public void test() throws Exception {
      // Create a MockWebServer. These are lean enough that you can create a new
      // instance for every unit test.
      MockWebServer server = new MockWebServer();
    
      // Schedule some responses.
      server.enqueue(new MockResponse().setBody("hello, world!"));
      server.enqueue(new MockResponse().setBody("sup, bra?"));
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 15:34:10 GMT 2023
    - 5K bytes
    - Viewed (1)
  2. mockwebserver/src/main/kotlin/mockwebserver3/MockResponse.kt

        fun streamHandler(streamHandler: StreamHandler) =
          apply {
            this.streamHandler = streamHandler
          }
    
        /**
         * Sets the response body to [body], chunked every [maxChunkSize] bytes.
         */
        fun chunkedBody(
          body: Buffer,
          maxChunkSize: Int,
        ) = apply {
          removeHeader("Content-Length")
          headers.add(CHUNKED_BODY_HEADER)
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 13.3K bytes
    - Viewed (1)
  3. mockwebserver/src/main/kotlin/mockwebserver3/internal/ThrottledSink.kt

     * limitations under the License.
     *
     */
    package mockwebserver3.internal
    
    import okio.Buffer
    import okio.Sink
    
    /**
     * A sink that sleeps [periodDelayNanos] every [bytesPerPeriod] bytes. Unlike [okio.Throttler],
     * this permits any interval to be used.
     */
    internal class ThrottledSink(
      private val delegate: Sink,
      private val bytesPerPeriod: Long,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/FastFallbackExchangeFinder.kt

    import okhttp3.internal.okHttpName
    
    /**
     * Speculatively connects to each IP address of a target address, returning as soon as one of them
     * connects successfully. This kicks off new attempts every 250 ms until a connect succeeds.
     */
    internal class FastFallbackExchangeFinder(
      override val routePlanner: RoutePlanner,
      private val taskRunner: TaskRunner,
    ) : ExchangeFinder {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  5. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/MockWebServerTest.kt

          fail<Any>()
        } catch (expected: IOException) {
        }
        server.url("/b").toUrl().openConnection().getInputStream() // Should succeed.
      }
    
      /**
       * Throttle the request body by sleeping 500ms after every 3 bytes. With a 6-byte request, this
       * should yield one sleep for a total delay of 500ms.
       */
      @Test
      fun throttleRequest() {
        assumeNotWindows()
        server.enqueue(
          MockResponse()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 21.9K bytes
    - Viewed (0)
  6. okhttp/build.gradle.kts

           - The compressed index.xml file contains a timestamp property which
           changes with every test execution, such that running the test
           actually changes the test classpath itself. This means that it
           can"t benefit from incremental build acceleration, because on every
           execution it sees that the classpath has changed, and so to be
           safe, it needs to re-run.
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Jan 04 05:32:07 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

      }
    
      /**
       * We've had a bug where we forget the HTTP response when we see response code 401. This causes a
       * new HTTP request to be issued for every call into the URLConnection.
       */
      @Test
      fun unauthorizedResponseHandling() {
        val mockResponse =
          MockResponse(
            code = HttpURLConnection.HTTP_UNAUTHORIZED,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Headers.kt

       * intended to be used as a metric: smaller headers are more efficient to encode and transmit.
       */
      fun byteCount(): Long {
        // Each header name has 2 bytes of overhead for ': ' and every header value has 2 bytes of
        // overhead for '\r\n'.
        var result = (namesAndValues.size * 2).toLong()
    
        for (i in 0 until namesAndValues.size) {
          result += namesAndValues[i].length.toLong()
        }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/connection/RouteSelector.kt

      private val postponedRoutes = mutableListOf<Route>()
    
      init {
        resetNextProxy(address.url, address.proxy)
      }
    
      /**
       * 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 {
    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)
  10. okhttp/src/test/java/okhttp3/internal/publicsuffix/PublicSuffixListGenerator.kt

            importResults.writeOut(sink)
          }
        }
    
      /**
       * These assertions ensure the [PublicSuffixDatabase] remains correct. The specification is
       * very flexible regarding wildcard rules, but this flexibility is not something currently used
       * in practice. To simplify the implementation, we've avoided implementing the flexible rules in
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 6K bytes
    - Viewed (0)
Back to top