接口 BaseWebSocketHandler
public interface BaseWebSocketHandler
BaseWebSocketHandler 基本接口 请与
ScxWebSocketRoute 配合使用- 版本:
- 1.0.10
- 作者:
- scx567888
-
方法概要
修饰符和类型方法说明default voidonBinaryMessage(io.vertx.core.buffer.Buffer binaryData, io.vertx.core.http.WebSocketFrame frame, io.vertx.core.http.ServerWebSocket webSocket, OnFrameRoutingContext context) 发送 二进制数据 时default voidonClose(io.vertx.core.http.ServerWebSocket webSocket, OnCloseRoutingContext context) 连接 关闭 时default voidonError(Throwable event, io.vertx.core.http.ServerWebSocket webSocket, OnExceptionRoutingContext context) 连接 错误 时default voidonOpen(io.vertx.core.http.ServerWebSocket webSocket, OnOpenRoutingContext context) 连接 打开 时default voidonTextMessage(String textData, io.vertx.core.http.WebSocketFrame frame, io.vertx.core.http.ServerWebSocket webSocket, OnFrameRoutingContext context) 发送 文本数据 时
-
方法详细资料
-
onOpen
default void onOpen(io.vertx.core.http.ServerWebSocket webSocket, OnOpenRoutingContext context) throws Exception 连接 打开 时- 参数:
webSocket- ServerWebSocket 连接对象context- s- 抛出:
Exception- e
-
onTextMessage
default void onTextMessage(String textData, io.vertx.core.http.WebSocketFrame frame, io.vertx.core.http.ServerWebSocket webSocket, OnFrameRoutingContext context) throws Exception 发送 文本数据 时- 参数:
textData- 文本数据frame- 帧对象webSocket- ServerWebSocket 连接对象context- a- 抛出:
Exception- e
-
onBinaryMessage
default void onBinaryMessage(io.vertx.core.buffer.Buffer binaryData, io.vertx.core.http.WebSocketFrame frame, io.vertx.core.http.ServerWebSocket webSocket, OnFrameRoutingContext context) throws Exception 发送 二进制数据 时- 参数:
binaryData- 二进制数据frame- 帧对象webSocket- ServerWebSocket 连接对象context- a- 抛出:
Exception- e
-
onClose
default void onClose(io.vertx.core.http.ServerWebSocket webSocket, OnCloseRoutingContext context) throws Exception 连接 关闭 时- 参数:
webSocket- ServerWebSocket 连接对象context- a- 抛出:
Exception- e
-
onError
default void onError(Throwable event, io.vertx.core.http.ServerWebSocket webSocket, OnExceptionRoutingContext context) throws Exception 连接 错误 时- 参数:
event- 发生的错误webSocket- ServerWebSocket 连接对象context- s- 抛出:
Exception- e
-