public interface WebSocketConnection extends Destroyable
A WebSocket connection
Destroyable.Util
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the connection.
|
boolean |
closed()
Check if the connection has been closed
|
void |
send(String message)
Send a text message through websocket
|
String |
sessionId()
Session ID of this connection
|
String |
username()
Returns the username which is gained when connection is setup by calling
H.KV.get(String) with AppConfig.sessionKeyUsername() |
destroy, isDestroyed, scope
String sessionId()
Session ID of this connection
String username()
Returns the username which is gained when connection is setup by calling H.KV.get(String)
with AppConfig.sessionKeyUsername()
null
if there is no logged in user when connection is setupvoid send(String message)
Send a text message through websocket
message
- the text messagevoid close()
Close the connection. Note if there are any IOException
raised by the underline network layer, it will be ignored
boolean closed()
Check if the connection has been closed
true
if connection is closedCopyright © 2014–2018 ActFramework. All rights reserved.