Package io.javalin.websocket
Class WsConfig
- java.lang.Object
-
- io.javalin.websocket.WsConfig
-
public class WsConfig extends Object
Holds the different WebSocket handlers for a specificWsEntryor the WebSocket logger.
-
-
Constructor Summary
Constructors Constructor Description WsConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonBinaryMessage(io.javalin.websocket.WsBinaryMessageHandler wsBinaryMessageHandler)Add aWsBinaryMessageHandlerto the WsHandler.voidonClose(io.javalin.websocket.WsCloseHandler wsCloseHandler)Add a WsCloseHandler to the WsHandler.voidonConnect(io.javalin.websocket.WsConnectHandler wsConnectHandler)Add a WsConnectHandler to the WsHandler.voidonError(io.javalin.websocket.WsErrorHandler wsErrorHandler)Add a wsErrorHandler to the WsHandler.voidonMessage(io.javalin.websocket.WsMessageHandler wsMessageHandler)Add a WsMessageHandler to the WsHandler.
-
-
-
Method Detail
-
onConnect
public void onConnect(@NotNull io.javalin.websocket.WsConnectHandler wsConnectHandler)Add a WsConnectHandler to the WsHandler. The handler is called when a WebSocket client connects.
-
onMessage
public void onMessage(@NotNull io.javalin.websocket.WsMessageHandler wsMessageHandler)Add a WsMessageHandler to the WsHandler. The handler is called when a WebSocket client sends a String message.
-
onBinaryMessage
public void onBinaryMessage(@NotNull io.javalin.websocket.WsBinaryMessageHandler wsBinaryMessageHandler)Add aWsBinaryMessageHandlerto the WsHandler. The handler is called when a WebSocket client sends a binary message.
-
onClose
public void onClose(@NotNull io.javalin.websocket.WsCloseHandler wsCloseHandler)Add a WsCloseHandler to the WsHandler. The handler is called when a WebSocket client closes the connection. The handler is not called in case of network issues, only when the client actively closes the connection (or times out).
-
onError
public void onError(@NotNull io.javalin.websocket.WsErrorHandler wsErrorHandler)Add a wsErrorHandler to the WsHandler. The handler is called when an error is detected.
-
-