public class KtOkHttpWebsocket extends Object implements KtWebsocket
| Modifier and Type | Class and Description |
|---|---|
class |
KtOkHttpWebsocket.KtWebsocketListener |
DEFAULT_SERVER_ENDPOINT_URI| Constructor and Description |
|---|
KtOkHttpWebsocket()
creates a new OkHttpWebsocket
|
KtOkHttpWebsocket(String url)
creates a new OkHttpWebsocket with the specified target url
|
KtOkHttpWebsocket(String url,
okhttp3.OkHttpClient client)
creates a new OkHttpWebsocket with the specified target url and a
provided client.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
boolean |
connect() |
void |
sendMessage(String message) |
void |
setManager(KtWebsocketManager manager) |
public KtOkHttpWebsocket()
public KtOkHttpWebsocket(String url)
url - the target url used when connection the websocketpublic KtOkHttpWebsocket(String url, okhttp3.OkHttpClient client)
url - the target url used when connection the websocketclient - the client that is used for the websocket.public void close()
close in interface KtWebsocketpublic boolean connect()
connect in interface KtWebsocketpublic void sendMessage(String message)
sendMessage in interface KtWebsocketpublic void setManager(KtWebsocketManager manager)
setManager in interface KtWebsocketCopyright © 2018. All rights reserved.