Class InternetDiscoveryChildrenHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.drasyl.handler.remote.internet.InternetDiscoveryChildrenHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
- Direct Known Subclasses:
TraversingInternetDiscoveryChildrenHandler
@UnstableApi
public class InternetDiscoveryChildrenHandler
extends io.netty.channel.ChannelDuplexHandler
Joins one or multiple super peer(s) as a children. Uses the super peer with the best RTT as a
default gateway for outbound messages.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionprotected InetSocketAddress
protected final LongSupplier
static final PeersManager.PathId
-
Constructor Summary
ConstructorDescriptionInternetDiscoveryChildrenHandler
(long initialPingDelayMillis) InternetDiscoveryChildrenHandler
(LongSupplier currentTime, long initialPingDelayMillis) -
Method Summary
Modifier and TypeMethodDescriptionvoid
channelActive
(io.netty.channel.ChannelHandlerContext ctx) void
channelInactive
(io.netty.channel.ChannelHandlerContext ctx) void
channelRead
(io.netty.channel.ChannelHandlerContext ctx, Object msg) protected static DrasylServerChannelConfig
config
(io.netty.channel.ChannelHandlerContext ctx) protected Set<InetSocketAddress>
void
handlerAdded
(io.netty.channel.ChannelHandlerContext ctx) protected boolean
void
userEventTriggered
(io.netty.channel.ChannelHandlerContext ctx, Object evt) protected void
writeHelloMessage
(io.netty.channel.ChannelHandlerContext ctx, DrasylAddress publicKey, InetSocketAddress inetAddress, Set<InetSocketAddress> privateInetAddresses) Make sure to callChannel.flush()
by your own!Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read, write
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Field Details
-
PATH_ID
-
currentTime
-
bindAddress
-
-
Constructor Details
-
InternetDiscoveryChildrenHandler
-
InternetDiscoveryChildrenHandler
public InternetDiscoveryChildrenHandler(long initialPingDelayMillis) -
InternetDiscoveryChildrenHandler
public InternetDiscoveryChildrenHandler()
-
-
Method Details
-
handlerAdded
- Specified by:
handlerAdded
in interfaceio.netty.channel.ChannelHandler
- Overrides:
handlerAdded
in classio.netty.channel.ChannelHandlerAdapter
- Throws:
UnknownHostException
-
channelActive
- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
UnknownHostException
-
channelInactive
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelInactive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classio.netty.channel.ChannelInboundHandlerAdapter
-
channelRead
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
-
userEventTriggered
- Specified by:
userEventTriggered
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
userEventTriggered
in classio.netty.channel.ChannelInboundHandlerAdapter
-
getPrivateAddresses
-
writeHelloMessage
protected void writeHelloMessage(io.netty.channel.ChannelHandlerContext ctx, DrasylAddress publicKey, InetSocketAddress inetAddress, Set<InetSocketAddress> privateInetAddresses) Make sure to callChannel.flush()
by your own! -
isUnexpectedMessage
-
config
-