@Service
@ChannelHandler.Sharable
public class NettyServerHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
heartbeat
心跳功能,默认值为0,则不生效
|
protected int |
maxSomeIp
网络安全之相同IP最大链接数,默认为:256
|
| 构造器和说明 |
|---|
NettyServerHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
void |
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object evt) |
channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChangedensureNotSharable, handlerAdded, handlerRemoved, isSharable@Value(value="network.heartbeat") protected int heartbeat
@Value(value="network.some.ip.max") protected int maxSomeIp
public 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.Exceptionpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object evt)
throws java.lang.Exception
userEventTriggered 在接口中 io.netty.channel.ChannelInboundHandleruserEventTriggered 在类中 io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause)
throws java.lang.Exception
exceptionCaught 在接口中 io.netty.channel.ChannelHandlerexceptionCaught 在接口中 io.netty.channel.ChannelInboundHandlerexceptionCaught 在类中 io.netty.channel.ChannelInboundHandlerAdapterjava.lang.Exception