public interface IWebsocketRequestBuilder extends IHttpRequestBuilder<IWebsocketRequestBuilder>
| Modifier and Type | Method and Description |
|---|---|
IWebsocketClientWriter |
connect(IWebsocketClientHandler handler)
Sends the request and establish the WebSocket connection.
|
IWebsocketRequestBuilder |
ping(int seconds)
You can use this to configure the pings that are automatically sent
to the Websocket endpoint every X seconds.
|
IHttpResponse |
send()
Sends the request and gets the
HTTP response. |
addCookie, addCookie, addCookies, addHeaderValue, addHeaderValues, disableSslCertificateErrors, setHeaders, setHeaderValues, setHttpAuthCredentials, setHttpClientBuilder, setRequestConfigIWebsocketRequestBuilder ping(int seconds)
IWebsocketClientHandler#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:
ISpincastHttpClientWithWebsocketConfig#isWebsocketAutomaticPingEnabled()
and
ISpincastHttpClientWithWebsocketConfig#getWebsocketAutomaticPingIntervalSeconds()
Pings are enabled by default.
seconds - the interval in seconds or <= 0 to disable the pings.IWebsocketClientWriter connect(IWebsocketClientHandler handler)
handler - The handler that is responsible to
handle the various WebSocket events.IHttpResponse send()
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.
send in interface IHttpRequestBuilder<IWebsocketRequestBuilder>Copyright © 2016. All rights reserved.