Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for cancelStream (0.28 sec)

  1. okhttp-testing-support/src/main/kotlin/okhttp3/internal/duplex/MockSocketHandler.kt

          }
        }
    
      fun exhaustRequest() =
        apply {
          actions += { stream ->
            if (!stream.source.exhausted()) throw AssertionError("expected exhausted")
          }
        }
    
      fun cancelStream() =
        apply {
          actions += { stream -> stream.cancel() }
        }
    
      fun requestIOException() =
        apply {
          actions += { stream ->
            try {
              stream.source.exhausted()
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Thu Jul 31 04:18:40 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  2. okhttp/src/jvmTest/kotlin/okhttp3/DuplexTest.kt

        val log: BlockingQueue<String?> = LinkedBlockingQueue()
        enableProtocol(Protocol.HTTP_2)
        val body =
          MockSocketHandler()
            .sendResponse("success!")
            .exhaustResponse()
            .cancelStream()
        server.enqueue(
          MockResponse
            .Builder()
            .clearHeaders()
            .socketHandler(body)
            .build(),
        )
        val call =
          client.newCall(
            Request
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Wed Jun 18 12:28:21 UTC 2025
    - 24.8K bytes
    - Viewed (0)
Back to top