Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 69 for Cancel (0.22 sec)

  1. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

       * if a socket connection is being established, that is terminated.
       */
      override fun cancel() {
        if (canceled) return // Already canceled.
    
        canceled = true
        exchange?.cancel()
        for (plan in plansToCancel) {
          plan.cancel()
        }
    
        eventListener.canceled(this)
      }
    
      override fun isCanceled(): Boolean = canceled
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  2. mockwebserver/src/main/kotlin/mockwebserver3/internal/duplex/RealStream.kt

      private val http2Stream: Http2Stream,
    ) : Stream {
      override val requestBody = http2Stream.getSource().buffer()
      override val responseBody = http2Stream.getSink().buffer()
    
      override fun cancel() {
        http2Stream.closeLater(ErrorCode.CANCEL)
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Dec 31 18:24:52 GMT 2022
    - 1.1K bytes
    - Viewed (0)
  3. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSource.kt

       * the event source has already been closed or canceled.
       */
      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(
    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)
  4. okhttp/src/main/kotlin/okhttp3/internal/connection/RealConnection.kt

            exchange.bodyComplete<IOException?>(-1L, responseDone = true, requestDone = true, e = null)
          }
    
          override fun cancel() {
            exchange.cancel()
          }
        }
      }
    
      override fun route(): Route = route
    
      override fun cancel() {
        // Close the raw socket so we don't end up doing synchronous I/O.
        rawSocket?.closeQuietly()
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  5. okhttp-coroutines/src/main/kotlin/okhttp3/JvmCallExtensions.kt

    @ExperimentalCoroutinesApi // resume with a resource cleanup.
    suspend fun Call.executeAsync(): Response =
      suspendCancellableCoroutine { continuation ->
        continuation.invokeOnCancellation {
          this.cancel()
        }
        this.enqueue(
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {
              continuation.resumeWithException(e)
            }
    
    Plain Text
    - Registered: Fri Apr 12 11:42:09 GMT 2024
    - Last Modified: Fri Apr 05 11:25:23 GMT 2024
    - 1.4K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/Interceptor.kt

     * includes both natural exceptions such as unreachable servers, as well as synthetic exceptions
     * when responses are of an unexpected type or cannot be decoded.
     *
     * Other exception types cancel the current call:
     *
     *  * For synchronous calls made with [Call.execute], the exception is propagated to the caller.
     *
     *  * For asynchronous calls made with [Call.enqueue], an [IOException] is propagated to the caller
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  7. docs/changelogs/changelog_4x.md

        }
        ```
    
     *  New: Upgrade to Okio 2.4.3.
    
        ```kotlin
        implementation("com.squareup.okio:okio:2.4.3")
        ```
    
     *  Fix: Limit retry attempts for HTTP/2 `REFUSED_STREAM` and `CANCEL` failures.
     *  Fix: Retry automatically when incorrectly sharing a connection among multiple hostnames. OkHttp
        shares connections when hosts share both IP addresses and certificates, such as `squareup.com`
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        assertThat(readAscii(in1, 5)).isEqualTo("ABCDE")
        in1.close()
        call1.cancel()
        val call2 = client.newCall(newRequest("/"))
        val response2 = call2.execute()
        val in2 = response2.body.byteStream()
        assertThat(readAscii(in2, 5)).isEqualTo("LMNOP")
        in2.close()
        call2.cancel()
        assertThat(server.takeRequest().sequenceNumber).isEqualTo(0)
        // Connection is pooled!
    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)
  9. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt

              this,
              IllegalStateException("Invalid content-type: ${body.contentType()}"),
              response,
            )
            return
          }
    
          // This is a long-lived response. Cancel full-call timeouts.
          call?.timeout()?.cancel()
    
          // Replace the body with a stripped one so the callbacks can't see real data.
          val response = response.stripBody()
    
          val reader = ServerSentEventReader(body.source(), this)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  10. okhttp-coroutines/src/test/kotlin/okhttp3/coroutines/ExecuteAsyncTest.kt

              .bodyDelay(5, TimeUnit.SECONDS)
              .body("abc")
              .build(),
          )
    
          val call = client.newCall(request)
    
          try {
            call.executeAsync().use {
              call.cancel()
              withContext(Dispatchers.IO) {
                it.body.string()
              }
              fail("No expected to get response")
            }
          } catch (ioe: IOException) {
            // expected
          }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 5.4K bytes
    - Viewed (0)
Back to top