All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.plugins.httpclient.websocket.builders.WebsocketRequestBuilder.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






WebsocketRequestBuilder (org.spincast:spincast-framework 1.0.0 API)












org.spincast.plugins.httpclient.websocket.builders

Interface WebsocketRequestBuilder

    • Method Detail

      • ping

        WebsocketRequestBuilder ping(int seconds)
        You can use this to configure the pings that are automatically sent to the Websocket endpoint every X seconds. WebsocketClientHandler#onConnectionClosed() will be called if the connection is closed.

        Use a value <= 0 to disable the pings.

        The automatic pings and their default interval are also configurable using: SpincastHttpClientWithWebsocketConfig#isWebsocketAutomaticPingEnabled()
        and
        SpincastHttpClientWithWebsocketConfig#getWebsocketAutomaticPingIntervalSeconds()

        Pings are enabled by default.

        Parameters:
        seconds - the interval in seconds or <= 0 to disable the pings.
      • connect

        WebsocketClientWriter connect(WebsocketClientHandler handler)
        Sends the request and establish the WebSocket connection.
        Parameters:
        handler - The handler that is responsible to handle the various WebSocket events.
        Returns:
        a writer to send WebSocket messages to the connected endpoint.
      • send

        HttpResponse send()
        Sends the request and gets the HTTP response. Does not make the actual upgrade to a WebSocket connection! Use the connect(...) method if you want the actual WebSocket connection to be made.

        This version is useful to debug the intermediate HTTP upgrade response made from the server before the actual WebSocket connection is established.

        Specified by:
        send in interface HttpRequestBuilder<WebsocketRequestBuilder>

Copyright © 2019. All rights reserved.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy