Constructor #
Initializes a new instance of the WebSocket class pointing to the Kuzzle server specified by the uri.
Arguments #
public WebSocket(URI uri, WebSocketOptions options) throws URISyntaxException, IllegalArgumentException
Argument | Type | Description |
---|---|---|
uri | Uri | URI pointing to a Kuzzle server |
options | WebSocketOptions | Class which contains websocket options |
uri #
A Uri object pointing to a Kuzzle server.
Use wss://<host>:<ip>
to initiate a secure SSL connection.
options #
The options used to connect to the Kuzzle instance. WebSocketOptions
Return #
A WebSocket
protocol instance.
Arguments #
public WebSocket(String host, WebSocketOptions options)
throws URISyntaxException, IllegalArgumentException
Argument | Type | Description |
---|---|---|
host | String | Host pointing to a Kuzzle server |
options | WebSocketOptions | Class which contains websocket options |
host #
A host pointing to a Kuzzle server.
Use wss://<host>:<ip>
to initiate a secure SSL connection.
options #
The options used to connect to the Kuzzle instance. WebSocketOptions
Return #
A WebSocket
protocol instance.
Usage #
WebSocketOptions options = new WebSocketOptions();
options.setAutoReconnect(true)
.setConnectionTimeout(42000)
.setPort(7513)
.setSsl(false);
WebSocket ws = new WebSocket("localhost", options);
Edit this page on Github(opens new window)