public class AsityWebSocketHandler extends Object implements io.vertx.core.Handler<io.vertx.core.http.ServerWebSocket>
Handler<io.vertx.core.http.ServerWebSocket> to provide VertxServerWebSocket.
AsityWebSocketHandler websocketHandler = new AsityWebSocketHandler().onwebsocket(ws -> {});
httpServer.websocketHandler(socket -> {
if (socket.path().equals("/cettia")) {
websocketHandler.handle(socket);
}
});
| Constructor and Description |
|---|
AsityWebSocketHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
handle(io.vertx.core.http.ServerWebSocket ws) |
AsityWebSocketHandler |
onwebsocket(Action<ServerWebSocket> action)
Registers an action to be called when
ServerWebSocket is available. |
public void handle(io.vertx.core.http.ServerWebSocket ws)
handle in interface io.vertx.core.Handler<io.vertx.core.http.ServerWebSocket>public AsityWebSocketHandler onwebsocket(Action<ServerWebSocket> action)
ServerWebSocket is available.Copyright © 2015–2019. All rights reserved.