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
public class InternetDiscoveryChildrenHandler
extends io.netty.channel.ChannelDuplexHandler
Joins one ore multiple super peer(s) as a children. Uses the super peer with the best latency as
 a default gateway for outbound messages.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from interface io.netty.channel.ChannelHandlerio.netty.channel.ChannelHandler.Sharable
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final LongSupplierprotected final longprotected final intprotected final ProofOfWorkprotected final IdentityPublicKeyprotected final DuplicatePathEventFilterprotected final longprotected final Map<IdentityPublicKey,org.drasyl.handler.remote.internet.InternetDiscoveryChildrenHandler.SuperPeer> 
- 
Constructor SummaryConstructorsConstructorDescriptionInternetDiscoveryChildrenHandler(int myNetworkId, IdentityPublicKey myPublicKey, ProofOfWork myProofOfWork, long initialPingDelayMillis, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, Map<IdentityPublicKey, InetSocketAddress> superPeerAddresses) InternetDiscoveryChildrenHandler(int myNetworkId, IdentityPublicKey myPublicKey, ProofOfWork myProofOfWork, LongSupplier currentTime, long initialPingDelayMillis, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, Map<IdentityPublicKey, InetSocketAddress> superPeerAddresses) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext ctx) voidchannelInactive(io.netty.channel.ChannelHandlerContext ctx) voidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) protected booleanvoidwrite(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) protected voidwriteDiscoveryMessage(io.netty.channel.ChannelHandlerContext ctx, DrasylAddress publicKey, InetSocketAddress inetAddress, boolean isChildrenJoin) Make sure to callChannel.flush()by your own!Methods inherited from class io.netty.channel.ChannelDuplexHandlerbind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapterchannelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapterensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandlerhandlerAdded, handlerRemoved
- 
Field Details- 
myNetworkIdprotected final int myNetworkId
- 
myPublicKey
- 
myProofOfWork
- 
currentTime
- 
pingTimeoutMillisprotected final long pingTimeoutMillis
- 
maxTimeOffsetMillisprotected final long maxTimeOffsetMillis
- 
superPeersprotected final Map<IdentityPublicKey,org.drasyl.handler.remote.internet.InternetDiscoveryChildrenHandler.SuperPeer> superPeers
- 
pathEventFilter
 
- 
- 
Constructor Details- 
InternetDiscoveryChildrenHandlerpublic InternetDiscoveryChildrenHandler(int myNetworkId, IdentityPublicKey myPublicKey, ProofOfWork myProofOfWork, LongSupplier currentTime, long initialPingDelayMillis, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, Map<IdentityPublicKey, InetSocketAddress> superPeerAddresses) 
- 
InternetDiscoveryChildrenHandlerpublic InternetDiscoveryChildrenHandler(int myNetworkId, IdentityPublicKey myPublicKey, ProofOfWork myProofOfWork, long initialPingDelayMillis, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, Map<IdentityPublicKey, InetSocketAddress> superPeerAddresses) 
 
- 
- 
Method Details- 
channelActivepublic void channelActive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
- channelActivein interface- io.netty.channel.ChannelInboundHandler
- Overrides:
- channelActivein class- io.netty.channel.ChannelInboundHandlerAdapter
 
- 
channelInactivepublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx) - Specified by:
- channelInactivein interface- io.netty.channel.ChannelInboundHandler
- Overrides:
- channelInactivein class- io.netty.channel.ChannelInboundHandlerAdapter
 
- 
channelRead- Specified by:
- channelReadin interface- io.netty.channel.ChannelInboundHandler
- Overrides:
- channelReadin class- io.netty.channel.ChannelInboundHandlerAdapter
 
- 
writepublic void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
- writein interface- io.netty.channel.ChannelOutboundHandler
- Overrides:
- writein class- io.netty.channel.ChannelDuplexHandler
 
- 
writeDiscoveryMessageprotected void writeDiscoveryMessage(io.netty.channel.ChannelHandlerContext ctx, DrasylAddress publicKey, InetSocketAddress inetAddress, boolean isChildrenJoin) Make sure to callChannel.flush()by your own!
- 
isUnexpectedMessage
 
-