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 |
|---|---|
ServerWebSocket |
binaryAction(Action<ByteBuffer> action)
Attaches an action for the binary frame.
|
void |
close()
Closes the connection.
|
ServerWebSocket |
closeAction(Action<Void> action)
Attaches an action for the close event.
|
protected abstract void |
doClose() |
protected abstract void |
doSend(ByteBuffer byteBuffer) |
protected abstract void |
doSend(String data) |
ServerWebSocket |
errorAction(Action<Throwable> action)
Attaches an action to handle error from various things.
|
ServerWebSocket |
send(ByteBuffer byteBuffer)
Sends a binary frame through the connection.
|
ServerWebSocket |
send(String data)
Sends a text frame through the connection.
|
ServerWebSocket |
textAction(Action<String> action)
Attaches an action for the text frame.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitunwrap, uriprotected final Actions<ByteBuffer> binaryActions
public 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 textAction(Action<String> action)
ServerWebSockettextAction in interface ServerWebSocketpublic ServerWebSocket binaryAction(Action<ByteBuffer> action)
ServerWebSocketbinaryAction in interface ServerWebSocketpublic ServerWebSocket closeAction(Action<Void> action)
ServerWebSocketcloseAction in interface ServerWebSocketpublic ServerWebSocket errorAction(Action<Throwable> action)
ServerWebSocketerrorAction in interface ServerWebSocketCopyright 2014, The Vibe Project