Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 24 for succeeded (0.2 sec)

  1. samples/guide/src/main/java/okhttp3/recipes/PerCallSettings.java

        OkHttpClient client1 = client.newBuilder()
            .readTimeout(500, TimeUnit.MILLISECONDS)
            .build();
        try (Response response = client1.newCall(request).execute()) {
          System.out.println("Response 1 succeeded: " + response);
        } catch (IOException e) {
          System.out.println("Response 1 failed: " + e);
        }
    
        // Copy to customize OkHttp for this request.
        OkHttpClient client2 = client.newBuilder()
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun May 22 01:29:42 GMT 2016
    - 1.9K bytes
    - Viewed (0)
  2. docs/releasing.md

          "s/version = \".*\"/version = \"$NEXT_VERSION\"/g" \
          build.gradle.kts
        git commit -am "Prepare next development version."
        git push
        ```
    
    7. Confirm the [GitHub Actions][github_actions] publish job succeeded.
    
    [github_actions]: https://github.com/square/okhttp/actions
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Dec 26 22:07:16 GMT 2022
    - 1.5K bytes
    - Viewed (0)
  3. docs/contribute/concurrency.md

    must block on writing I/O. We can't return from a write until we've pushed its bytes onto the socket. Otherwise, if the write fails we are unable to deliver its IOException to the application. We would have told the application layer that the write succeeded, but it didn't!
    
    The application-layer can also do blocking reads. If the application asks to read and there's nothing available, we need to hold that thread until either the bytes arrive, the stream is closed, or a timeout elapses. If we...
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 16:35:36 GMT 2022
    - 7K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/SocksProxy.kt

              throw ProtocolException("unexpected address: " + toSocket.localAddress)
            }
    
            // Write the reply.
            fromSink.writeByte(VERSION_5)
            fromSink.writeByte(REPLY_SUCCEEDED)
            fromSink.writeByte(0)
            fromSink.writeByte(ADDRESS_TYPE_IPV4)
            fromSink.write(localAddress)
            fromSink.writeShort(toSocket.localPort)
            fromSink.emit()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  5. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSource.kt

       */
      fun cancel()
    
      fun interface Factory {
        /**
         * Creates a new event source and immediately returns it. Creating an event source initiates an
         * asynchronous process to connect the socket. Once that succeeds or fails, `listener` will be
         * notified. The caller must cancel the returned event source when it is no longer in use.
         */
        fun newEventSource(
          request: Request,
          listener: EventSourceListener,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        val inputStream = response.body.byteStream()
        assertThat(inputStream.read().toChar()).isEqualTo('A')
        call.cancel()
        assertFailsWith<IOException> {
          // Reading 'B' may succeed if it's buffered.
          inputStream.read()
    
          // But 'C' shouldn't be buffered (the response is throttled) and this should fail.
          inputStream.read()
        }
        inputStream.close()
      }
    
    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)
  7. samples/guide/src/main/java/okhttp3/recipes/kt/PerCallSettings.kt

        val client1 =
          client.newBuilder()
            .readTimeout(500, TimeUnit.MILLISECONDS)
            .build()
        try {
          client1.newCall(request).execute().use { response ->
            println("Response 1 succeeded: $response")
          }
        } catch (e: IOException) {
          println("Response 1 failed: $e")
        }
    
        // Copy to customize OkHttp for this request.
        val client2 =
          client.newBuilder()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  8. regression-test/src/androidTest/java/okhttp/regression/compare/AndroidHttpEngineTest.kt

                buffer.write(byteBuffer)
                byteBuffer.clear()
                request.read(byteBuffer)
              }
    
              override fun onSucceeded(
                request: UrlRequest,
                info: UrlResponseInfo,
              ) {
                println("onSucceeded ${info.headers.asMap}")
                completableFuture.complete(Response(info.httpStatusCode, info.negotiatedProtocol, buffer.readUtf8()))
              }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 24 13:19:43 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/internal/connection/FailedPlan.kt

     *  * Preemptive proxy authentication failed.
     *
     * Planning failures are not necessarily fatal. For example, even if we can't DNS lookup the first
     * proxy in a list, looking up a subsequent one may succeed.
     */
    internal class FailedPlan(e: Throwable) : RoutePlanner.Plan {
      val result = RoutePlanner.ConnectResult(plan = this, throwable = e)
    
      override val isReady = false
    
      override fun connectTcp() = result
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Dec 20 23:27:07 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  10. 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 {
      private val connectDelayNanos = TimeUnit.MILLISECONDS.toNanos(250L)
    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)
Back to top