public class MqttWsMsgHandler extends Object implements org.tio.websocket.server.handler.IWsMsgHandler
| 构造器和说明 |
|---|
MqttWsMsgHandler(MqttServerCreator serverCreator,
String[] supportedSubProtocols,
org.tio.core.intf.TioHandler aioHandler) |
MqttWsMsgHandler(MqttServerCreator serverCreator,
org.tio.core.intf.TioHandler aioHandler) |
| 限定符和类型 | 方法和说明 |
|---|---|
org.tio.websocket.common.WsResponse |
encodeSubProtocol(org.tio.core.intf.Packet packet,
org.tio.core.TioConfig tioConfig,
org.tio.core.ChannelContext context) |
String[] |
getSupportedSubProtocols() |
org.tio.http.common.HttpResponse |
handshake(org.tio.http.common.HttpRequest request,
org.tio.http.common.HttpResponse httpResponse,
org.tio.core.ChannelContext channelContext) |
void |
onAfterHandshaked(org.tio.http.common.HttpRequest request,
org.tio.http.common.HttpResponse response,
org.tio.core.ChannelContext context)
握手后处理
|
Object |
onBytes(org.tio.websocket.common.WsRequest wsRequest,
byte[] bytes,
org.tio.core.ChannelContext context)
字节消息(binaryType = arraybuffer)过来后会走这个方法
|
Object |
onClose(org.tio.websocket.common.WsRequest wsRequest,
byte[] bytes,
org.tio.core.ChannelContext context)
当客户端发 close flag 时,会走这个方法
|
Object |
onText(org.tio.websocket.common.WsRequest wsRequest,
String text,
org.tio.core.ChannelContext context)
字符消息(binaryType = blob)过来后会走这个方法
|
public MqttWsMsgHandler(MqttServerCreator serverCreator, org.tio.core.intf.TioHandler aioHandler)
public MqttWsMsgHandler(MqttServerCreator serverCreator, String[] supportedSubProtocols, org.tio.core.intf.TioHandler aioHandler)
public String[] getSupportedSubProtocols()
getSupportedSubProtocols 在接口中 org.tio.websocket.server.handler.IWsSubProtocolsMsgHandlerpublic org.tio.http.common.HttpResponse handshake(org.tio.http.common.HttpRequest request,
org.tio.http.common.HttpResponse httpResponse,
org.tio.core.ChannelContext channelContext)
handshake 在接口中 org.tio.websocket.server.handler.IWsMsgHandlerpublic void onAfterHandshaked(org.tio.http.common.HttpRequest request,
org.tio.http.common.HttpResponse response,
org.tio.core.ChannelContext context)
onAfterHandshaked 在接口中 org.tio.websocket.server.handler.IWsMsgHandlerrequest - HttpRequestresponse - HttpResponsecontext - ChannelContextpublic Object onBytes(org.tio.websocket.common.WsRequest wsRequest, byte[] bytes, org.tio.core.ChannelContext context) throws Exception
onBytes 在接口中 org.tio.websocket.server.handler.IWsMsgHandlerExceptionpublic org.tio.websocket.common.WsResponse encodeSubProtocol(org.tio.core.intf.Packet packet,
org.tio.core.TioConfig tioConfig,
org.tio.core.ChannelContext context)
encodeSubProtocol 在接口中 org.tio.websocket.server.handler.IWsSubProtocolsMsgHandlerpublic Object onClose(org.tio.websocket.common.WsRequest wsRequest, byte[] bytes, org.tio.core.ChannelContext context)
onClose 在接口中 org.tio.websocket.server.handler.IWsMsgHandlerCopyright © 2022. All rights reserved.