public abstract class AbstractServerWebSocket extends Object implements ServerWebSocket
ServerWebSocket.| Modifier and Type | Field and Description |
|---|---|
protected Actions<Void> |
closeActions |
protected Actions<Throwable> |
errorActions |
protected Actions<Data> |
messageActions |
| Constructor and Description |
|---|
AbstractServerWebSocket() |
| Modifier and Type | Method and Description |
|---|---|
ServerWebSocket |
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 |
messageAction(Action<Data> action)
Attaches an action for the message event.
|
ServerWebSocket |
send(ByteBuffer byteBuffer)
Sends bytes message through the connection
|
ServerWebSocket |
send(String data)
Sends a text message through the connection.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waituripublic ServerWebSocket 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 messageAction(Action<Data> action)
ServerWebSocketString for text messages. If the message is quite big, it may
drain memory quickly.messageAction in interface ServerWebSocketpublic ServerWebSocket errorAction(Action<Throwable> action)
ServerWebSocketerrorAction in interface ServerWebSocketpublic ServerWebSocket closeAction(Action<Void> action)
ServerWebSocketcloseAction in interface ServerWebSocketCopyright 2014, The Vibe Project