public class WebSocketClient extends Object
| Constructor and Description |
|---|
WebSocketClient(String host,
int port,
boolean tls,
String context,
WebSocketClientCallback callback) |
| Modifier and Type | Method and Description |
|---|---|
<T extends com.google.protobuf.Message> |
call(String type,
DataObserver<? extends com.google.protobuf.Message> observer)
Initiates a new call.
|
void |
cancelCall(int callId) |
io.netty.channel.ChannelFuture |
connect(String accessToken) |
void |
disconnect() |
void |
enableTcpKeepAlive(boolean enableTcpKeepAlive)
Enable/disable the TCP Keep-Alive on websocket sockets.
|
int |
getMaxFramePayloadLength() |
void |
handleMessage(ServerMessage message) |
boolean |
isConnected() |
boolean |
isInsecureTls() |
void |
setCaCertFile(String caCertFile)
In case of https connections, this file contains the CA certificates that are used to verify server certificate
|
void |
setConnectionTimeoutMs(int timeoutMs) |
void |
setInsecureTls(boolean insecureTls)
if true and https connections are used, do not verify server certificate
|
void |
setMaxFramePayloadLength(int maxFramePayloadLength) |
void |
setMessageLogging(Level level)
Enables logging of all inbound and outbound messages on the request logging level.
|
void |
setUserAgent(String userAgent) |
io.netty.util.concurrent.Future<?> |
shutdown() |
public WebSocketClient(String host, int port, boolean tls, String context, WebSocketClientCallback callback)
public void setUserAgent(String userAgent)
public void setConnectionTimeoutMs(int timeoutMs)
public void setMessageLogging(Level level)
By default set to Level.FINEST
public io.netty.channel.ChannelFuture connect(String accessToken) throws SSLException, GeneralSecurityException
SSLExceptionGeneralSecurityExceptionpublic <T extends com.google.protobuf.Message> Observer<T> call(String type, DataObserver<? extends com.google.protobuf.Message> observer)
public void cancelCall(int callId)
throws IOException
IOExceptionpublic void disconnect()
public void enableTcpKeepAlive(boolean enableTcpKeepAlive)
enableTcpKeepAlive - if true the TCP SO_KEEPALIVE option is setpublic io.netty.util.concurrent.Future<?> shutdown()
public boolean isConnected()
public void setCaCertFile(String caCertFile) throws IOException, GeneralSecurityException
caCertFile - IOExceptionGeneralSecurityExceptionpublic boolean isInsecureTls()
public void setInsecureTls(boolean insecureTls)
insecureTls - public int getMaxFramePayloadLength()
public void setMaxFramePayloadLength(int maxFramePayloadLength)
public void handleMessage(ServerMessage message) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionCopyright © 2022 Space Applications Services. All rights reserved.