@ChannelHandler.Sharable
public final class ConnectionLimitingHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
ConnectionLimitingHandler instance would be set to AbstractBootstrap.handler(ChannelHandler).| Constructor and Description |
|---|
ConnectionLimitingHandler(int maxNumConnections) |
| Modifier and Type | Method and Description |
|---|---|
void |
channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
Set<io.netty.channel.Channel> |
children()
Returns the immutable set of child
Channels. |
int |
maxNumConnections()
Returns the maximum allowed number of open connections.
|
int |
numConnections()
Returns the number of open connections.
|
static int |
validateMaxNumConnections(int maxNumConnections)
Validates the maximum allowed number of open connections.
|
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic ConnectionLimitingHandler(int maxNumConnections)
public void channelRead(io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface io.netty.channel.ChannelInboundHandlerchannelRead in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic int maxNumConnections()
public int numConnections()
public Set<io.netty.channel.Channel> children()
Channels.public static int validateMaxNumConnections(int maxNumConnections)
Copyright © 2020 LeanCloud. All rights reserved.