Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for SELECT (0.25 sec)

  1. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/ServerSentEventReader.kt

       */
      @Throws(IOException::class)
      fun processNextEvent(): Boolean {
        var id = lastId
        var type: String? = null
        val data = Buffer()
    
        while (true) {
          when (source.select(options)) {
            in 0..2 -> {
              completeEvent(id, type, data)
              return true
            }
    
            in 3..4 -> {
              source.readData(data)
            }
    
            in 5..7 -> {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  2. okhttp-idna-mapping-table/src/main/kotlin/okhttp3/internal/idn/SimpleIdnaMappingTable.kt

        skipWhitespace()
        val type = select(optionsType)
    
        when (type) {
          TYPE_DEVIATION, TYPE_MAPPED, TYPE_DISALLOWED_STD3_MAPPED -> {
            skipWhitespace()
            if (readByte() != ';'.code.toByte()) throw IOException("expected ';'")
    
            // Like "0061" or "0031 2044 0034".
            while (true) {
              skipWhitespace()
    
              when (select(optionsDelimiter)) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  3. okhttp-testing-support/src/main/kotlin/okhttp3/FakeProxySelector.kt

    class FakeProxySelector : ProxySelector() {
      val proxies: MutableList<Proxy> = mutableListOf()
    
      fun addProxy(proxy: Proxy): FakeProxySelector {
        proxies.add(proxy)
        return this
      }
    
      override fun select(uri: URI): List<Proxy> {
        // Don't handle 'socket' schemes, which the RI's Socket class may request (for SOCKS).
        return if (uri.scheme == "http" || uri.scheme == "https") proxies else listOf(Proxy.NO_PROXY)
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.3K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/internal/http/RecordingProxySelector.kt

    class RecordingProxySelector : ProxySelector() {
      @JvmField val proxies = mutableListOf<Proxy>()
    
      private val requestedUris = mutableListOf<URI>()
      private val failures = mutableListOf<String>()
    
      override fun select(uri: URI): List<Proxy> {
        requestedUris.add(uri)
        return proxies
      }
    
      fun assertRequests(vararg expectedUris: URI?) {
        assertThat(requestedUris).containsExactly(*expectedUris)
        requestedUris.clear()
    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)
  5. okhttp/src/main/kotlin/okhttp3/internal/proxy/NullProxySelector.kt

    import java.net.ProxySelector
    import java.net.SocketAddress
    import java.net.URI
    
    /**
     * A proxy selector that always returns the [Proxy.NO_PROXY].
     */
    object NullProxySelector : ProxySelector() {
      override fun select(uri: URI?): List<Proxy> {
        requireNotNull(uri) { "uri must not be null" }
        return listOf(Proxy.NO_PROXY)
      }
    
      override fun connectFailed(
        uri: URI?,
        sa: SocketAddress?,
        ioe: IOException?,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.1K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        )
        server.enqueue(
          MockResponse(code = 407),
        )
        client =
          client.newBuilder()
            .proxySelector(
              object : ProxySelector() {
                override fun select(uri: URI): List<Proxy> = listOf(server.toProxyAddress())
    
                override fun connectFailed(
                  uri: URI,
                  socketAddress: SocketAddress,
                  e: IOException,
    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. okhttp/src/test/java/okhttp3/internal/idn/StringprepReader.kt

      val target = Buffer()
      while (!exhausted()) {
        skipWhitespace()
        val sourceCodePoint = readHexadecimalUnsignedLong().toInt()
        skipWhitespace()
        if (select(optionsSemicolon) != 0) throw IOException("expected ';'")
        skipWhitespace()
        while (select(optionsSemicolon) == -1) {
          val targetCodePoint = readHexadecimalUnsignedLong().toInt()
          target.writeUtf8CodePoint(targetCodePoint)
          skipWhitespace()
        }
    Plain Text
    - Registered: Fri Mar 29 11:42:11 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/SocksProxyTest.kt

      }
    
      @Test
      fun proxySelector() {
        server.enqueue(MockResponse.Builder().body("abc").build())
        val proxySelector: ProxySelector =
          object : ProxySelector() {
            override fun select(uri: URI) = listOf(socksProxy.proxy())
    
            override fun connectFailed(
              uri: URI,
              socketAddress: SocketAddress,
              e: IOException,
            ) = error("unexpected call")
          }
    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)
  9. okhttp/src/main/kotlin/okhttp3/internal/platform/Jdk8WithJettyBootPlatform.kt

            return null
          } else if (methodName == "protocols" && callArgs.isEmpty()) {
            return protocols // Client advertises these protocols.
          } else if ((methodName == "selectProtocol" || methodName == "select") &&
            String::class.java == returnType && callArgs.size == 1 && callArgs[0] is List<*>
          ) {
            val peerProtocols = callArgs[0] as List<*>
            // Pick the first known protocol the peer advertises.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/connection/RouteSelectorTest.kt

        proxySelector.assertRequests() // No proxy selector requests!
      }
    
      @Test fun proxySelectorReturnsNull() {
        val nullProxySelector: ProxySelector =
          object : ProxySelector() {
            override fun select(uri: URI): List<Proxy>? {
              assertThat(uri.host).isEqualTo(uriHost)
              return null
            }
    
            override fun connectFailed(
              uri: URI,
              socketAddress: SocketAddress,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Mar 06 17:33:38 GMT 2024
    - 20.8K bytes
    - Viewed (0)
Back to top