Top Description Fields Constructors Methods
io.netty.handler.ipfilter

public Class UniqueIpFilter

extends AbstractRemoteAddressFilter<InetSocketAddress>
Class Inheritance
Annotations
@Sharable
Imports
io.netty.channel.Channel, .ChannelFuture, .ChannelFutureListener, .ChannelHandler, .ChannelHandlerContext, io.netty.util.internal.ConcurrentSet, java.net.InetAddress, .InetSocketAddress, java.util.Set

This class allows one to ensure that at all times for every IP address there is at most one Channel connected to the server.

Field Summary

Modifier and TypeField and Description
private final Set<InetAddress>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected boolean
accept(ChannelHandlerContext ctx, InetSocketAddress remoteAddress)

Implements abstract io.netty.handler.ipfilter.AbstractRemoteAddressFilter.accept.

This method is called immediately after a io.netty.channel.Channel gets registered.
Inherited from io.netty.handler.ipfilter.AbstractRemoteAddressFilter:
channelAcceptedchannelActivechannelRegisteredchannelRejected

Field Detail

connectedback to summary
private final Set<InetAddress> connected

Constructor Detail

UniqueIpFilterback to summary
public UniqueIpFilter()

Method Detail

acceptback to summary
protected boolean accept(ChannelHandlerContext ctx, InetSocketAddress remoteAddress) throws Exception

Implements abstract io.netty.handler.ipfilter.AbstractRemoteAddressFilter.accept.

Doc from io.netty.handler.ipfilter.AbstractRemoteAddressFilter.accept.

This method is called immediately after a io.netty.channel.Channel gets registered.

Returns:boolean

Return true if connections from this IP address and port should be accepted. False otherwise.

Annotations
@Override