public interface WebSocketAdapter
Modifier and Type | Method and Description |
---|---|
void |
closeClient()
Close the client.
|
void |
closeIncommingSession()
Close the incomming session.
|
void |
closeOutgoingSession()
Close the outgoing session.
|
void |
connect(URI url)
Connects to the given
URI . |
void |
onWebSocketBinary(byte[] data,
int offset,
int length)
Callback to be called when binary data retrieved.
|
void |
onWebSocketClose(int statusCode,
String reason)
Callback to be called when closed.
|
void |
onWebSocketConnect()
Callback to be called when connected.
|
void |
onWebSocketConnectError(Throwable cause)
Callback to be called on connect error.
|
void |
onWebSocketConnecting()
Callback to be called when connecting.
|
void |
onWebSocketError(Throwable cause)
Callback to be called on error.
|
void |
onWebSocketText(String message)
Callback to be called when closed.
|
void |
send(Object content)
Sends the provided content.
|
void |
start()
Starts the client.
|
void connect(URI url) throws Exception
URI
.url
- the target urlException
- in case of errorvoid send(Object content) throws IOException
content
- the content to be sentIOException
- in case of errorvoid closeIncommingSession() throws Exception
Exception
- in case of errorvoid closeOutgoingSession() throws Exception
Exception
- in case of errorvoid closeClient() throws Exception
Exception
- in case of errorvoid onWebSocketConnecting()
void onWebSocketConnect()
void onWebSocketClose(int statusCode, String reason)
statusCode
- the status codereason
- the reasonvoid onWebSocketText(String message)
message
- the messagevoid onWebSocketBinary(byte[] data, int offset, int length)
data
- the bytesoffset
- start offsetlength
- the lengthvoid onWebSocketConnectError(Throwable cause)
cause
- the causevoid onWebSocketError(Throwable cause)
cause
- the causeCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.