public class WsClient extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
org.tio.client.ClientChannelContext |
getClientChannelContext() |
WsClientConfig |
getConfig() |
String |
getRawUri() |
org.tio.client.TioClient |
getTioClient() |
URI |
getUri() |
WebSocket |
getWs() |
public static WsClient create(String uri) throws Exception
uri - The uri to connectIOExceptionExceptionpublic 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 handshakeIOExceptionExceptionpublic 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.IOExceptionExceptionpublic 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.IOExceptionExceptionpublic void close()
public WebSocket getWs()
public WsClientConfig getConfig()
public org.tio.client.TioClient getTioClient()
public org.tio.client.ClientChannelContext getClientChannelContext()
public URI getUri()
public String getRawUri()
Copyright © 2022. All rights reserved.