Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for newWebSocket (0.15 sec)

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

              throw e
            }
          },
        )
        newWebSocket()
        assertThat(testLogHandler.take()).isEqualTo("INFO: [WS client] onFailure")
      }
    
      @Test
      fun throwingOnMessageClosesImmediatelyAndFails() {
        webServer.enqueue(
          MockResponse.Builder()
            .webSocketUpgrade(serverListener)
            .build(),
        )
        newWebSocket()
        clientListener.assertOpen()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 35.2K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/AutobahnTester.kt

     */
    class AutobahnTester {
      val client = OkHttpClient()
    
      private fun newWebSocket(
        path: String,
        listener: WebSocketListener,
      ): WebSocket {
        val request =
          Request.Builder()
            .url(HOST + path)
            .build()
        return client.newWebSocket(request, listener)
      }
    
      fun run() {
        try {
          val count = getTestCount()
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  3. samples/guide/src/main/java/okhttp3/recipes/WebSocketEcho.java

            .readTimeout(0,  TimeUnit.MILLISECONDS)
            .build();
    
        Request request = new Request.Builder()
            .url("ws://echo.websocket.org")
            .build();
        client.newWebSocket(request, this);
    
        // Trigger shutdown of the dispatcher's executor so this process exits immediately.
        client.dispatcher().executorService().shutdown();
      }
    
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Thu Apr 04 11:40:21 UTC 2024
    - 1.6K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/DispatcherTest.kt

      }
    
      @Test
      fun maxPerHostNotEnforcedForWebSockets() {
        dispatcher.maxRequestsPerHost = 2
        client.newWebSocket(newRequest("http://a/1"), webSocketListener)
        client.newWebSocket(newRequest("http://a/2"), webSocketListener)
        client.newWebSocket(newRequest("http://a/3"), webSocketListener)
        executor.assertJobs("http://a/1", "http://a/2", "http://a/3")
      }
    
      @Test
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Apr 05 03:30:42 UTC 2024
    - 12.7K bytes
    - Viewed (0)
  5. samples/slack/src/main/java/okhttp3/slack/SlackApi.java

          return jsonAdapter.fromJson(response.body().source());
        }
      }
    
      /** See https://api.slack.com/rtm. */
      public WebSocket rtm(HttpUrl url, WebSocketListener listener) {
        return httpClient.newWebSocket(new Request.Builder()
            .url(url)
            .build(), listener);
      }
    
      static final class SlackJsonAdapters {
        @ToJson String urlToJson(HttpUrl httpUrl) {
          return httpUrl.toString();
        }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Fri Jul 06 19:30:55 UTC 2018
    - 4.4K bytes
    - Viewed (0)
  6. okhttp/src/main/kotlin/okhttp3/WebSocket.kt

         * notified. The caller must either close or cancel the returned web socket when it is no longer
         * in use.
         */
        fun newWebSocket(
          request: Request,
          listener: WebSocketListener,
        ): WebSocket
      }
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  7. okhttp/api/okhttp.api

    	public final fun networkInterceptors ()Ljava/util/List;
    	public fun newBuilder ()Lokhttp3/OkHttpClient$Builder;
    	public fun newCall (Lokhttp3/Request;)Lokhttp3/Call;
    	public fun newWebSocket (Lokhttp3/Request;Lokhttp3/WebSocketListener;)Lokhttp3/WebSocket;
    	public final fun pingIntervalMillis ()I
    	public final fun protocols ()Ljava/util/List;
    	public final fun proxy ()Ljava/net/Proxy;
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 15 13:41:01 UTC 2024
    - 70.2K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/KotlinSourceModernTest.kt

        val pingIntervalMillis: Int = client.pingIntervalMillis
        val call: Call = client.newCall(Request.Builder().build())
        val webSocket: WebSocket =
          client.newWebSocket(
            Request.Builder().build(),
            object : WebSocketListener() {
            },
          )
        val newBuilder: OkHttpClient.Builder = client.newBuilder()
      }
    
      @Test
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Apr 01 14:21:25 UTC 2024
    - 46.5K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/OkHttpClient.kt

      override fun newCall(request: Request): Call = RealCall(this, request, forWebSocket = false)
    
      /** Uses [request] to connect a new web socket. */
      override fun newWebSocket(
        request: Request,
        listener: WebSocketListener,
      ): WebSocket {
        val webSocket =
          RealWebSocket(
            taskRunner = taskRunner,
            originalRequest = request,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sat Apr 06 04:21:33 UTC 2024
    - 52K bytes
    - Viewed (0)
  10. docs/changelogs/changelog_3x.md

    _2016-11-30_
    
     *  **Web Sockets are now a stable feature of OkHttp.** Since being introduced as a beta feature in
        OkHttp 2.3 our web socket client has matured. Connect to a server's web socket with
        `OkHttpClient.newWebSocket()`, send messages with `send()`, and receive messages with the
        `WebSocketListener`.
    
        The `okhttp-ws` submodule is no longer available and `okhttp-ws` artifacts from previous
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Feb 06 14:55:54 UTC 2022
    - 50.8K bytes
    - Viewed (0)
Back to top