Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 100 for Cancel (0.19 sec)

  1. 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)
  2. 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)
  3. 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)
  4. okhttp/src/main/kotlin/okhttp3/internal/http2/Http2Stream.kt

      @Throws(IOException::class)
      internal fun cancelStreamIfNecessary() {
        lock.assertNotHeld()
    
        val open: Boolean
        val cancel: Boolean
        this.withLock {
          cancel = !source.finished && source.closed && (sink.finished || sink.closed)
          open = isOpen
        }
        if (cancel) {
          // RST this stream to prevent additional data from being sent. This is safe because the input
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 23.2K bytes
    - Viewed (1)
  5. okhttp-sse/api/okhttp-sse.api

    public abstract interface class okhttp3/sse/EventSource {
    	public abstract fun cancel ()V
    	public abstract fun request ()Lokhttp3/Request;
    }
    
    public abstract interface class okhttp3/sse/EventSource$Factory {
    	public abstract fun newEventSource (Lokhttp3/Request;Lokhttp3/sse/EventSourceListener;)Lokhttp3/sse/EventSource;
    }
    
    public abstract class okhttp3/sse/EventSourceListener {
    	public fun <init> ()V
    	public fun onClosed (Lokhttp3/sse/EventSource;)V
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 17 14:39:59 GMT 2023
    - 1.1K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. okhttp/src/main/kotlin/okhttp3/internal/http2/ErrorCode.kt

    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  9. 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)
  10. okhttp/src/test/java/okhttp3/DuplexTest.kt

        assertFailsWith<IOException> {
          requestBody.writeUtf8("request body\n")
          requestBody.flush()
        }.also { expected ->
          assertThat(expected.message)
            .isEqualTo("stream was reset: CANCEL")
        }
        body.awaitSuccess()
        assertThat(listener.recordedEventTypes()).containsExactly(
          "CallStart", "ProxySelectStart", "ProxySelectEnd", "DnsStart", "DnsEnd", "ConnectStart",
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 23.9K bytes
    - Viewed (0)
Back to top