Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for random (0.44 sec)

  1. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

      private val serverWriter =
        WebSocketWriter(
          isClient = false,
          sink = data,
          random = random,
          perMessageDeflate = false,
          noContextTakeover = false,
          minimumDeflateSize = 0L,
        )
      private val clientWriter =
        WebSocketWriter(
          isClient = true,
          sink = data,
          random = random,
          perMessageDeflate = false,
          noContextTakeover = false,
          minimumDeflateSize = 0L,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  2. docs/features/events.md

    The `EventListener.Factory` also makes it possible to limit metrics to a subset of calls. This one captures metrics on a random 10%:
    
    ```java
    class MetricsEventListener extends EventListener {
      private static final Factory FACTORY = new Factory() {
        @Override public EventListener create(Call call) {
          if (Math.random() < 0.10) {
            return new MetricsEventListener(call);
          } else {
            return EventListener.NONE;
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Feb 06 02:19:09 GMT 2022
    - 7.7K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/kt/WiresharkExample.kt

          connection: Connection,
        ) {
          if (random != null) {
            val sslSocket = connection.socket() as SSLSocket
            val session = sslSocket.session
    
            val masterSecretHex =
              session.masterSecret?.encoded?.toByteString()
                ?.hex()
    
            if (masterSecretHex != null) {
              val keyLog = "CLIENT_RANDOM $random $masterSecretHex"
    
              if (verbose) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 10.7K bytes
    - Viewed (1)
  4. mockwebserver/src/main/kotlin/mockwebserver3/MockWebServer.kt

            }
          }
        val webSocket =
          RealWebSocket(
            taskRunner = taskRunner,
            originalRequest = fancyRequest,
            listener = webSocketResponse.webSocketListener!!,
            random = SecureRandom(),
            pingIntervalMillis = 0,
            extensions = WebSocketExtensions.parse(webSocketResponse.headers),
            // Compress all messages if compression is enabled.
            minimumDeflateSize = 0L,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Mar 31 17:16:15 GMT 2024
    - 37.4K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/internal/http2/HuffmanTest.kt

        val s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
        for (i in s.indices) {
          assertRoundTrip(s.substring(0, i).encodeUtf8())
        }
        val random = Random(123456789L)
        val buf = ByteArray(4096)
        random.nextBytes(buf)
        assertRoundTrip(buf.toByteString())
      }
    
      private fun assertRoundTrip(data: ByteString) {
        val encodeBuffer = Buffer()
        encode(data, encodeBuffer)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Jan 04 05:32:07 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/internal/ws/WebSocketWriter.kt

     *
     * This class is not thread safe.
     *
     * [rfc_6455]: http://tools.ietf.org/html/rfc6455
     */
    class WebSocketWriter(
      private val isClient: Boolean,
      val sink: BufferedSink,
      val random: Random,
      private val perMessageDeflate: Boolean,
      private val noContextTakeover: Boolean,
      private val minimumDeflateSize: Long,
    ) : Closeable {
      /** This holds outbound data for compression and masking. */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.9K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/internal/ws/RealWebSocketTest.kt

      // zero effect on the behavior of the WebSocket API which is why tests are only written once
      // from the perspective of a single peer.
      private val random = Random(0)
      private val client2Server = Pipe(8192L)
      private val server2client = Pipe(8192L)
      private val taskFaker = TaskFaker()
      private val client = TestStreams(true, taskFaker, server2client, client2Server)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 01:59:58 GMT 2024
    - 18.5K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/internal/cache2/FileOperator.kt

    /**
     * Read and write a target file. Unlike Okio's built-in `Okio.source(java.io.File file)` and `Okio.sink(java.io.File file)`
     * this class offers:
     *
     *  * **Read/write:** read and write using the same operator.
     *  * **Random access:** access any position within the file.
     *  * **Shared channels:** read and write a file channel that's shared between
     * multiple operators. Note that although the underlying [FileChannel] may be shared,
    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)
  9. okhttp/src/test/java/okhttp3/internal/ws/WebSocketReaderTest.kt

    import org.junit.jupiter.api.AfterEach
    import org.junit.jupiter.api.Test
    
    class WebSocketReaderTest {
      private val data = Buffer()
      private val callback = WebSocketRecorder("client")
      private val random = Random(0)
    
      // Mutually exclusive. Use the one corresponding to the peer whose behavior you wish to test.
      private val serverReader =
        WebSocketReader(
          isClient = false,
          source = data,
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 14.4K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/cache2/FileOperatorTest.kt

     * limitations under the License.
     */
    package okhttp3.internal.cache2
    
    import assertk.assertThat
    import assertk.assertions.isEqualTo
    import java.io.File
    import java.io.RandomAccessFile
    import java.util.Random
    import kotlin.test.assertFailsWith
    import okio.Buffer
    import okio.ByteString
    import okio.ByteString.Companion.encodeUtf8
    import okio.buffer
    import okio.sink
    import okio.source
    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)
Back to top