public class MBWebsocketClientInboundHandler
extends io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.websocketx.WebSocketFrame>
ServerCoreHandler,
net.x52im.mobileimsdk.server.ServerLauncher#initGateWays()| 构造器和说明 |
|---|
MBWebsocketClientInboundHandler(ServerCoreHandler serverCoreHandler) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx)
客户端与服务端建立“连接”时会调用本方法。
|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
客户端与服务端断开“连接”时会调用本方法。
|
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
客户端向服务端发送数据时会调用本方法。
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable e)
“会话”处理过程中出现异步时会调用本方法。
|
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic MBWebsocketClientInboundHandler(ServerCoreHandler serverCoreHandler)
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable e)
exceptionCaught 在接口中 io.netty.channel.ChannelHandlerexceptionCaught 在接口中 io.netty.channel.ChannelInboundHandlerexceptionCaught 在类中 io.netty.channel.ChannelInboundHandlerAdapterpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
channelActive 在接口中 io.netty.channel.ChannelInboundHandlerchannelActive 在类中 io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws java.lang.Exception
“断开”的原因有可能多种可能性:
channelInactive 在接口中 io.netty.channel.ChannelInboundHandlerchannelInactive 在类中 io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionprotected void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
throws java.lang.Exception
本方法是"客户端 to 服务端"这个方向的数据通信唯一处理方法。
channelRead0 在类中 io.netty.channel.SimpleChannelInboundHandler<io.netty.handler.codec.http.websocketx.WebSocketFrame>java.lang.Exception