Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 105 for Unit (0.18 sec)

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

              return -1L
            }
          },
        )
        return null
      }
    
      private fun awaitTcpConnect(
        timeout: Long,
        unit: TimeUnit,
      ): ConnectResult? {
        if (tcpConnectsInFlight.isEmpty()) return null
    
        val result = connectResults.poll(timeout, unit) ?: return null
    
        tcpConnectsInFlight.remove(result.plan)
    
        return result
      }
    
      private fun cancelInFlightConnects() {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.8K bytes
    - Viewed (0)
  2. mockwebserver-deprecated/src/main/kotlin/okhttp3/mockwebserver/MockResponse.kt

      }
    
      fun getBodyDelay(unit: TimeUnit): Long = unit.convert(bodyDelayAmount, bodyDelayUnit)
    
      fun setHeadersDelay(
        delay: Long,
        unit: TimeUnit,
      ) = apply {
        headersDelayAmount = delay
        headersDelayUnit = unit
      }
    
      fun getHeadersDelay(unit: TimeUnit): Long = unit.convert(headersDelayAmount, headersDelayUnit)
    
      fun withPush(promise: PushPromise) =
        apply {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/internal/cache/FaultHidingSink.kt

    import okio.ForwardingSink
    import okio.Sink
    
    /** A sink that never throws IOExceptions, even if the underlying sink does. */
    internal open class FaultHidingSink(
      delegate: Sink,
      val onException: (IOException) -> Unit,
    ) : ForwardingSink(delegate) {
      private var hasErrors = false
    
      override fun write(
        source: Buffer,
        byteCount: Long,
      ) {
        if (hasErrors) {
          source.skip(byteCount)
          return
        }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  4. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Adapters.kt

          name = "NULL",
          tagClass = DerHeader.TAG_CLASS_UNIVERSAL,
          tag = 5L,
          codec =
            object : BasicDerAdapter.Codec<Unit?> {
              override fun decode(reader: DerReader): Unit? = null
    
              override fun encode(
                writer: DerWriter,
                value: Unit?,
              ) {
              }
            },
        )
    
      val OBJECT_IDENTIFIER =
        BasicDerAdapter(
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15K bytes
    - Viewed (0)
  5. okhttp/src/main/kotlin/okhttp3/internal/concurrent/Task.kt

     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    package okhttp3.internal.concurrent
    
    /**
     * A unit of work that can be executed one or more times.
     *
     * Recurrence
     * ----------
     *
     * Tasks control their recurrence schedule. The [runOnce] function returns -1L to signify that the
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.4K bytes
    - Viewed (0)
  6. okhttp-testing-support/src/main/kotlin/okhttp3/internal/concurrent/TaskFaker.kt

        private var editCount = 0
    
        override fun poll(): T = delegate.poll()
    
        override fun poll(
          timeout: Long,
          unit: TimeUnit,
        ): T? {
          taskRunner.lock.withLock {
            val waitUntil = nanoTime + unit.toNanos(timeout)
            while (true) {
              val result = poll()
              if (result != null) return result
              if (nanoTime >= waitUntil) return null
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Apr 29 00:33:04 GMT 2024
    - 12.6K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/-UtilJvm.kt

        4 -> UTF_32LE
        -1 -> default
        else -> throw AssertionError()
      }
    }
    
    internal fun checkDuration(
      name: String,
      duration: Long,
      unit: TimeUnit,
    ): Int {
      check(duration >= 0L) { "$name < 0" }
      val millis = unit.toMillis(duration)
      require(millis <= Integer.MAX_VALUE) { "$name too large" }
      require(millis != 0L || duration <= 0L) { "$name too small" }
      return millis.toInt()
    }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Tue Jan 09 12:33:05 GMT 2024
    - 10.5K bytes
    - Viewed (0)
  8. container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt

          assertThat(connection.inputStream.source().buffer().readUtf8()).contains("Peter the person")
        }
      }
    
      private fun testRequest(function: (MockServerClient) -> Unit) {
        MockServerClient(mockServer.host, mockServer.serverPort).use { mockServerClient ->
          val request =
            request().withPath("/person")
              .withQueryStringParameter("name", "peter")
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Fri Apr 05 03:30:42 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/ClientRuleEventListener.kt

    import java.net.InetAddress
    import java.net.InetSocketAddress
    import java.net.Proxy
    import java.util.concurrent.TimeUnit
    
    class ClientRuleEventListener(
      val delegate: EventListener = NONE,
      var logger: (String) -> Unit,
    ) : EventListener(),
      EventListener.Factory {
      private var startNs: Long? = null
    
      override fun create(call: Call): EventListener = this
    
      override fun callStart(call: Call) {
        startNs = System.nanoTime()
    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. mockwebserver/src/main/kotlin/mockwebserver3/internal/duplex/MockStreamHandler.kt

        }
      }
    
      fun exhaustResponse() =
        apply {
          actions += { stream -> stream.responseBody.close() }
        }
    
      fun sleep(
        duration: Long,
        unit: TimeUnit,
      ) = apply {
        actions += { Thread.sleep(unit.toMillis(duration)) }
      }
    
      override fun handle(stream: Stream) {
        val task = serviceStreamTask(stream)
        results.add(task)
        task.run()
      }
    
    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)
Back to top