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) |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
unwrap, uri
protected final Actions<ByteBuffer> binaryActions
public void close()
ServerWebSocket
close
in interface ServerWebSocket
protected abstract void doClose()
public ServerWebSocket send(String data)
ServerWebSocket
send
in interface ServerWebSocket
public ServerWebSocket send(ByteBuffer byteBuffer)
ServerWebSocket
send
in interface ServerWebSocket
protected abstract void doSend(ByteBuffer byteBuffer)
protected abstract void doSend(String data)
public ServerWebSocket ontext(Action<String> action)
ServerWebSocket
ontext
in interface ServerWebSocket
public ServerWebSocket onbinary(Action<ByteBuffer> action)
ServerWebSocket
onbinary
in interface ServerWebSocket
public ServerWebSocket onclose(Action<Void> action)
ServerWebSocket
onclose
in interface ServerWebSocket
public ServerWebSocket onerror(Action<Throwable> action)
ServerWebSocket
onerror
in interface ServerWebSocket
Copyright © 2015–2016. All rights reserved.