public class WsClient extends Object
Modifier and Type | Method and Description |
---|---|
void |
close() |
WebSocket |
connect()
connect to server
|
static WsClient |
create(String uri)
To create a WsClient.
|
static WsClient |
create(String uri,
Map<String,String> additionalHttpHeaders)
To create a WsClient.
|
static WsClient |
create(String uri,
Map<String,String> additionalHttpHeaders,
WsClientConfig config)
To create a WsClient.
|
static WsClient |
create(String uri,
WsClientConfig config)
To create a WsClient.
|
ClientChannelContext |
getClientChannelContext() |
WsClientConfig |
getConfig() |
String |
getRawUri() |
TioClient |
getTioClient() |
URI |
getUri() |
WebSocket |
getWs() |
public static WsClient create(String uri) throws Exception
uri
- The uri to connectIOException
Exception
public static WsClient create(String uri, Map<String,String> additionalHttpHeaders) throws Exception
uri
- The uri to connectadditionalHttpHeaders
- Additional headers added to the http package sent to the server
during the handshakeIOException
Exception
public static WsClient create(String uri, WsClientConfig config) throws Exception
uri
- The uri to connectconfig
- The config of client. If you change the value later, you need to bear the
possible consequences.IOException
Exception
public static WsClient create(String uri, Map<String,String> additionalHttpHeaders, WsClientConfig config) throws Exception
uri
- The uri to connectadditionalHttpHeaders
- Additional headers added to the http package sent to the server
during the handshakeconfig
- The config of client. If you change the value later, you need to bear the
possible consequences.IOException
Exception
public WebSocket connect() throws Exception
Exception
public void close()
public WebSocket getWs()
public WsClientConfig getConfig()
public TioClient getTioClient()
public ClientChannelContext getClientChannelContext()
public URI getUri()
public String getRawUri()
Copyright © 2021. All rights reserved.