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, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public MBWebsocketClientInboundHandler(ServerCoreHandler serverCoreHandler)
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable e)
exceptionCaught
在接口中 io.netty.channel.ChannelHandler
exceptionCaught
在接口中 io.netty.channel.ChannelInboundHandler
exceptionCaught
在类中 io.netty.channel.ChannelInboundHandlerAdapter
public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
channelActive
在接口中 io.netty.channel.ChannelInboundHandler
channelActive
在类中 io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
“断开”的原因有可能多种可能性:
channelInactive
在接口中 io.netty.channel.ChannelInboundHandler
channelInactive
在类中 io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
protected 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