Class ServerNewConnectionsGuard
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.SimpleChannelInboundHandler<Message>
-
- org.drasyl.peer.connection.server.handler.ServerNewConnectionsGuard
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class ServerNewConnectionsGuard extends io.netty.channel.SimpleChannelInboundHandler<Message>
This handler acts as a channel creation guard. A new channel should not be created, if theisOpenSupplier
returnsfalse
. Used by theServer
to prevent new connections from being established during shutdown.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONNECTION_GUARD
-
Constructor Summary
Constructors Constructor Description ServerNewConnectionsGuard(int networkId, Identity identity, BooleanSupplier acceptNewConnectionsSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
channelRead0(io.netty.channel.ChannelHandlerContext ctx, Message msg)
-
Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
acceptInboundMessage, channelRead
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
CONNECTION_GUARD
public static final String CONNECTION_GUARD
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ServerNewConnectionsGuard
public ServerNewConnectionsGuard(int networkId, Identity identity, BooleanSupplier acceptNewConnectionsSupplier)
-
-