Package io.netty.handler.ipfilter
Class UniqueIpFilter
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.ipfilter.AbstractRemoteAddressFilter<InetSocketAddress>
-
- io.netty.handler.ipfilter.UniqueIpFilter
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@Sharable public class UniqueIpFilter extends AbstractRemoteAddressFilter<InetSocketAddress>
This class allows one to ensure that at all times for every IP address there is at most oneChannelconnected to the server.
-
-
Constructor Summary
Constructors Constructor Description UniqueIpFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanaccept(io.netty.channel.ChannelHandlerContext ctx, InetSocketAddress remoteAddress)This method is called immediately after aChannelgets registered.-
Methods inherited from class io.netty.handler.ipfilter.AbstractRemoteAddressFilter
channelAccepted, channelActive, channelRegistered, channelRejected
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Method Detail
-
accept
protected boolean accept(io.netty.channel.ChannelHandlerContext ctx, InetSocketAddress remoteAddress) throws ExceptionDescription copied from class:AbstractRemoteAddressFilterThis method is called immediately after aChannelgets registered.- Specified by:
acceptin classAbstractRemoteAddressFilter<InetSocketAddress>- Returns:
- Return true if connections from this IP address and port should be accepted. False otherwise.
- Throws:
Exception
-
-