public class WsServerHandler extends io.netty.channel.SimpleChannelInboundHandler<Object>
| 限定符和类型 | 字段和说明 |
|---|---|
static io.netty.util.AttributeKey<io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker> |
HandshakerKey |
static io.netty.util.AttributeKey<String> |
ResourceDescriptorKey |
| 构造器和说明 |
|---|
WsServerHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
channelReadComplete(io.netty.channel.ChannelHandlerContext ctx) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
发生异常时执行的操作
|
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
客户端掉线时的操作
|
void |
handleWebSocketFrame(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame) |
channelActive, channelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredpublic static final io.netty.util.AttributeKey<String> ResourceDescriptorKey
public static final io.netty.util.AttributeKey<io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker> HandshakerKey
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
public void channelReadComplete(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelReadComplete 在接口中 io.netty.channel.ChannelInboundHandlerchannelReadComplete 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void handleWebSocketFrame(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.websocketx.WebSocketFrame frame)
throws Exception
Exceptionpublic void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerRemoved 在接口中 io.netty.channel.ChannelHandlerhandlerRemoved 在类中 io.netty.channel.ChannelHandlerAdapterExceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught 在接口中 io.netty.channel.ChannelHandlerexceptionCaught 在接口中 io.netty.channel.ChannelInboundHandlerexceptionCaught 在类中 io.netty.channel.ChannelInboundHandlerAdapterExceptionCopyright © 2023. All rights reserved.