Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 12 for socketPolicy (0.06 seconds)

  1. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/SocketPolicy.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.mockwebserver
    
    enum class SocketPolicy {
      SHUTDOWN_SERVER_AFTER_RESPONSE,
      KEEP_OPEN,
      DISCONNECT_AT_END,
      UPGRADE_TO_SSL_AT_END,
      DISCONNECT_AT_START,
      DISCONNECT_AFTER_REQUEST,
      DISCONNECT_DURING_REQUEST_BODY,
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1K bytes
    - Click Count (0)
  2. mockwebserver-deprecated/api/mockwebserver.api

    	public static final field DISCONNECT_DURING_RESPONSE_BODY Lokhttp3/mockwebserver/SocketPolicy;
    	public static final field DO_NOT_READ_REQUEST_BODY Lokhttp3/mockwebserver/SocketPolicy;
    	public static final field EXPECT_CONTINUE Lokhttp3/mockwebserver/SocketPolicy;
    	public static final field FAIL_HANDSHAKE Lokhttp3/mockwebserver/SocketPolicy;
    	public static final field KEEP_OPEN Lokhttp3/mockwebserver/SocketPolicy;
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Sat Jul 22 12:28:51 GMT 2023
    - 10.2K bytes
    - Click Count (0)
  3. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

      @Deprecated(
        message = "moved to var",
        replaceWith = ReplaceWith(expression = "socketPolicy"),
        level = DeprecationLevel.ERROR,
      )
      fun getSocketPolicy(): SocketPolicy = socketPolicy
    
      fun setSocketPolicy(socketPolicy: SocketPolicy) =
        apply {
          this.socketPolicy = socketPolicy
        }
    
      @JvmName("-deprecated_getHttp2ErrorCode")
      @Deprecated(
        message = "moved to var",
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Sat May 10 11:15:14 GMT 2025
    - 7.1K bytes
    - Click Count (1)
  4. mockwebserver-deprecated/src/test/java/okhttp3/mockwebserver/KotlinSourceModernTest.kt

        mockResponse = mockResponse.setBody(Buffer())
        mockResponse = mockResponse.setChunkedBody(Buffer(), 0)
        mockResponse = mockResponse.setChunkedBody("", 0)
        var socketPolicy: SocketPolicy = mockResponse.socketPolicy
        mockResponse.socketPolicy = SocketPolicy.KEEP_OPEN
        var http2ErrorCode: Int = mockResponse.http2ErrorCode
        mockResponse.http2ErrorCode = 0
        mockResponse = mockResponse.throttleBody(0L, 0L, TimeUnit.SECONDS)
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.3K bytes
    - Click Count (0)
  5. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/DeprecationBridge.kt

      result.trailers(trailers)
    
      when (socketPolicy) {
        SocketPolicy.EXPECT_CONTINUE, SocketPolicy.CONTINUE_ALWAYS -> {
          result.add100Continue()
        }
    
        SocketPolicy.UPGRADE_TO_SSL_AT_END -> {
          result.inTunnel()
        }
    
        SocketPolicy.SHUTDOWN_SERVER_AFTER_RESPONSE -> {
          result.shutdownServer(true)
        }
    
        SocketPolicy.KEEP_OPEN -> {
          Unit
        }
    
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 4.3K bytes
    - Click Count (1)
  6. okhttp/src/jvmTest/kotlin/okhttp3/KotlinDeprecationErrorTest.kt

        val mockResponse = MockResponse()
        var status: String = mockResponse.getStatus()
        var headers: Headers = mockResponse.getHeaders()
        var trailers: Headers = mockResponse.getTrailers()
        var socketPolicy: SocketPolicy = mockResponse.getSocketPolicy()
        var http2ErrorCode: Int = mockResponse.getHttp2ErrorCode()
      }
    
      @Test @Disabled
      fun mockWebServer() {
        val mockWebServer = MockWebServer()
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Fri Dec 27 13:39:56 GMT 2024
    - 13.3K bytes
    - Click Count (0)
  7. okhttp/src/jvmTest/kotlin/okhttp3/KotlinSourceModernTest.kt

        mockResponse = mockResponse.setBody(Buffer())
        mockResponse = mockResponse.setChunkedBody(Buffer(), 0)
        mockResponse = mockResponse.setChunkedBody("", 0)
        var socketPolicy: SocketPolicy = mockResponse.socketPolicy
        mockResponse.socketPolicy = SocketPolicy.KEEP_OPEN
        var http2ErrorCode: Int = mockResponse.http2ErrorCode
        mockResponse.http2ErrorCode = 0
        mockResponse = mockResponse.throttleBody(0L, 0L, TimeUnit.SECONDS)
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Mar 10 21:47:20 GMT 2026
    - 49.7K bytes
    - Click Count (0)
  8. CHANGELOG.md

        use chunked encoding. This is different from an empty list - that indicates the request is
        chunked but has no data.
    
     *  Breaking: Replace `SocketPolicy` with a new type, `SocketEffect`. It splits triggers (request
        start, response body, etc.) from effects (closing the socket, closing the stream, etc.).
    
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Sun Feb 15 11:57:47 GMT 2026
    - 36.2K bytes
    - Click Count (2)
  9. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/Dispatcher.kt

    abstract class Dispatcher {
      @Throws(InterruptedException::class)
      abstract fun dispatch(request: RecordedRequest): MockResponse
    
      open fun peek(): MockResponse = MockResponse().apply { this.socketPolicy = SocketPolicy.KEEP_OPEN }
    
      open fun shutdown() {}
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Wed Mar 19 19:25:20 GMT 2025
    - 894 bytes
    - Click Count (0)
  10. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

              logger.fine(
                "${this@MockWebServer} received request: $request and responded: $response",
              )
            }
    
            // See warnings associated with these socket policies in SocketPolicy.
            if (handleSocketEffect(response.onResponseEnd, socket)) {
              return false
            }
    
            return reuseSocket
          } finally {
            if (response.shutdownServer) {
              close()
    Created: Fri Apr 03 11:42:14 GMT 2026
    - Last Modified: Tue Jan 27 09:00:39 GMT 2026
    - 40.3K bytes
    - Click Count (0)
Back to Top