public abstract class WebsocketSession extends Object
WebsocketDispatcher
to handle incoming and outgoing traffic.Modifier | Constructor and Description |
---|---|
protected |
WebsocketSession(ChannelHandlerContext ctx,
HttpRequest request)
Creates a new session for the given channel and request.
|
Modifier and Type | Method and Description |
---|---|
protected sirius.kernel.commons.Value |
get(String key)
Reads the given parameter from the query string of the underlying request.
|
protected sirius.kernel.commons.Value |
getCookie(String key)
Reads the given parameter from the query string of the underlying request.
|
abstract void |
onFrame(WebSocketFrame frame)
Invoked for each frame received via the websocket.
|
void |
onWebsocketClosed()
Tirggered when the websocket is closed.
|
void |
onWebsocketOpened()
Triggered when the websocket was sucessfully initialized.
|
void |
sendMessage(String text)
Sents a given string as text frame to the client.
|
protected WebsocketSession(ChannelHandlerContext ctx, HttpRequest request)
ctx
- the channel (context) which started the websocketrequest
- the request made before upgrading to websocketprotected sirius.kernel.commons.Value get(String key)
key
- the name of the parameter to fetchprotected sirius.kernel.commons.Value getCookie(String key)
key
- the name of the parameter to fetchpublic void onWebsocketOpened()
public void onWebsocketClosed()
public abstract void onFrame(WebSocketFrame frame)
frame
- the received framepublic void sendMessage(String text)
text
- the string to sendCopyright © 2018. All rights reserved.