Package ortus.boxlang.web.handlers
Class WebsocketHandler
java.lang.Object
io.undertow.server.handlers.PathHandler
ortus.boxlang.web.handlers.WebsocketHandler
- All Implemented Interfaces:
io.undertow.server.HttpHandler
public class WebsocketHandler
extends io.undertow.server.handlers.PathHandler
The WebsocketHandler is a handler that handles WebSocket connections.
Based on Undertow.
-
Constructor Summary
ConstructorsConstructorDescriptionWebsocketHandler(io.undertow.server.HttpHandler next, String prefixPath) Create a new WebsocketHandler. -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcastMessage(String message) Broadcast a message to all open connections.Set<io.undertow.websockets.core.WebSocketChannel> Get all connectionsvoidsendMessage(io.undertow.websockets.core.WebSocketChannel channel, String message) Send a message to a WebSocket channel.Methods inherited from class io.undertow.server.handlers.PathHandler
addExactPath, addPath, addPrefixPath, clearPaths, handleRequest, removeExactPath, removePath, removePrefixPath, toString
-
Constructor Details
-
WebsocketHandler
Create a new WebsocketHandler.- Parameters:
next- The next handler in the chainprefixPath- The prefix path
-
-
Method Details
-
getConnections
Get all connections -
sendMessage
Send a message to a WebSocket channel.- Parameters:
channel- The WebSocket channelmessage- The message to send
-
broadcastMessage
Broadcast a message to all open connections.- Parameters:
message- The message to broadcast
-