public class UndertowWebSocketConnection extends DestroyableBase implements WebSocketConnection
Destroyable.Utillogger| Constructor and Description |
|---|
UndertowWebSocketConnection(io.undertow.websockets.core.WebSocketChannel channel,
org.osgl.http.H.Session session) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the connection.
|
boolean |
closed()
Check if the connection has been closed
|
protected void |
releaseResources() |
void |
send(java.lang.String message)
Send a text message through websocket
|
java.lang.String |
sessionId()
Session ID of this connection
|
java.lang.String |
username()
Returns the username which is gained when connection is setup by calling
H.KV.get(String) with AppConfig.sessionKeyUsername() |
addSubResource, destroy, isDestroyed, reload, scopedebug, debug, error, error, fatal, fatal, info, info, isDebugEnabled, isTraceEnabled, trace, trace, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdestroy, isDestroyed, scopepublic UndertowWebSocketConnection(io.undertow.websockets.core.WebSocketChannel channel,
org.osgl.http.H.Session session)
public java.lang.String sessionId()
WebSocketConnectionSession ID of this connection
sessionId in interface WebSocketConnectionpublic java.lang.String username()
WebSocketConnectionReturns the username which is gained when connection is setup by calling H.KV.get(String) with AppConfig.sessionKeyUsername()
username in interface WebSocketConnectionnull if there is no logged in user when connection is setuppublic void send(java.lang.String message)
WebSocketConnectionSend a text message through websocket
send in interface WebSocketConnectionmessage - the text messageprotected void releaseResources()
releaseResources in class DestroyableBasepublic void close()
WebSocketConnectionClose the connection. Note if there are any IOException raised by the underline network layer, it will be ignored
close in interface WebSocketConnectionpublic boolean closed()
WebSocketConnectionCheck if the connection has been closed
closed in interface WebSocketConnectiontrue if connection is closedCopyright © 2014–2017 ActFramework. All rights reserved.