Package marauroa.server.net.web
Class WebSocketChannel
java.lang.Object
marauroa.server.net.web.WebSocketChannel
a websocket connection to a client
- Author:
- hendrik
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()closes the websocket channelgets the ip-address and portgets the usernamevoidonClose(jakarta.websocket.Session session, jakarta.websocket.CloseReason closeReason) voidvoidonOpen(jakarta.websocket.Session session, jakarta.websocket.EndpointConfig config) voidonWebSocketText(String message) voidsendMessage(String json) sends a message to the client
-
Constructor Details
-
WebSocketChannel
public WebSocketChannel()
-
-
Method Details
-
onOpen
public void onOpen(jakarta.websocket.Session session, jakarta.websocket.EndpointConfig config) -
onWebSocketText
-
onClose
public void onClose(jakarta.websocket.Session session, jakarta.websocket.CloseReason closeReason) -
onError
-
getAddress
gets the ip-address and port- Returns:
- address
-
getUsername
gets the username- Returns:
- username
-
sendMessage
sends a message to the client- Parameters:
json- json string to send
-
close
public void close()closes the websocket channel
-