- java.lang.Object
-
- io.netty5.handler.ipfilter.AbstractRemoteAddressFilter<InetSocketAddress>
-
- io.netty5.handler.ipfilter.UniqueIpFilter
-
- All Implemented Interfaces:
io.netty5.channel.ChannelHandler
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.netty5.channel.ChannelHandlerContext ctx, InetSocketAddress remoteAddress)This method is called immediately after aChannelgets registered.booleanisSharable()-
Methods inherited from class io.netty5.handler.ipfilter.AbstractRemoteAddressFilter
channelAccepted, channelActive, channelRegistered, channelRejected
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelExceptionCaught, channelInactive, channelInboundEvent, channelRead, channelReadComplete, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, handlerAdded, handlerRemoved, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
-
-
-
Method Detail
-
isSharable
public boolean isSharable()
-
accept
protected boolean accept(io.netty5.channel.ChannelHandlerContext ctx, InetSocketAddress remoteAddress)Description 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.
-
-