public abstract class AbstractServerWebSocket extends Object implements ServerWebSocket
ServerWebSocket.| Modifier and Type | Field and Description |
|---|---|
protected Actions<ByteBuffer> |
binaryActions |
protected Actions<Void> |
closeActions |
protected Actions<Throwable> |
errorActions |
protected Actions<String> |
textActions |
| Constructor and Description |
|---|
AbstractServerWebSocket() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
protected abstract void |
doClose() |
protected abstract void |
doSend(ByteBuffer byteBuffer) |
protected abstract void |
doSend(String data) |
String |
header(String name)
Returns the first handshake request header associated with the given name.
|
ServerWebSocket |
onbinary(Action<ByteBuffer> action)
Attaches an action for the binary frame.
|
ServerWebSocket |
onclose(Action<Void> action)
Attaches an action for the close event.
|
ServerWebSocket |
onerror(Action<Throwable> action)
Attaches an action to handle error from various things.
|
ServerWebSocket |
ontext(Action<String> action)
Attaches an action for the text frame.
|
ServerWebSocket |
send(ByteBuffer byteBuffer)
Sends a binary frame through the connection.
|
ServerWebSocket |
send(String data)
Sends a text frame through the connection.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitheaderNames, headers, unwrap, uriprotected final Actions<ByteBuffer> binaryActions
public String header(String name)
ServerWebSocketheader in interface ServerWebSocketpublic void close()
ServerWebSocketclose in interface ServerWebSocketprotected abstract void doClose()
public ServerWebSocket send(String data)
ServerWebSocketsend in interface ServerWebSocketpublic ServerWebSocket send(ByteBuffer byteBuffer)
ServerWebSocketsend in interface ServerWebSocketprotected abstract void doSend(ByteBuffer byteBuffer)
protected abstract void doSend(String data)
public ServerWebSocket ontext(Action<String> action)
ServerWebSocketontext in interface ServerWebSocketpublic ServerWebSocket onbinary(Action<ByteBuffer> action)
ServerWebSocketonbinary in interface ServerWebSocketpublic ServerWebSocket onclose(Action<Void> action)
ServerWebSocketonclose in interface ServerWebSocketpublic ServerWebSocket onerror(Action<Throwable> action)
ServerWebSocketonerror in interface ServerWebSocketCopyright © 2015–2019. All rights reserved.