Class TraversingInternetDiscoveryChildrenHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.drasyl.handler.remote.internet.InternetDiscoveryChildrenHandler
org.drasyl.handler.remote.internet.TraversingInternetDiscoveryChildrenHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
Extends
InternetDiscoveryChildrenHandler
by performing a rendezvous initiated by one of
our super peers.-
Nested Class Summary
Nested classes/interfaces inherited from class org.drasyl.handler.remote.internet.InternetDiscoveryChildrenHandler
InternetDiscoveryChildrenHandler.SuperPeer
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Fields inherited from class org.drasyl.handler.remote.internet.InternetDiscoveryChildrenHandler
bindAddress, currentTime, maxTimeOffsetMillis, myNetworkId, myProofOfWork, myPublicKey, pathEventFilter, pingTimeoutMillis, superPeers
-
Constructor Summary
ConstructorsConstructorDescriptionTraversingInternetDiscoveryChildrenHandler
(int myNetworkId, IdentityPublicKey myPublicKey, IdentitySecretKey mySecretKey, ProofOfWork myProofOfWork, long initialPingDelayMillis, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, Map<IdentityPublicKey, InetSocketAddress> superPeerAddresses, long pingCommunicationTimeoutMillis, long maxPeers) -
Method Summary
Modifier and TypeMethodDescriptionvoid
channelRead
(io.netty.channel.ChannelHandlerContext ctx, Object msg) protected Set<InetSocketAddress>
void
write
(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class org.drasyl.handler.remote.internet.InternetDiscoveryChildrenHandler
channelActive, channelInactive, isUnexpectedMessage, userEventTriggered, writeHelloMessage
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, 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
handlerAdded, handlerRemoved
-
Constructor Details
-
TraversingInternetDiscoveryChildrenHandler
public TraversingInternetDiscoveryChildrenHandler(int myNetworkId, IdentityPublicKey myPublicKey, IdentitySecretKey mySecretKey, ProofOfWork myProofOfWork, long initialPingDelayMillis, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, Map<IdentityPublicKey, InetSocketAddress> superPeerAddresses, long pingCommunicationTimeoutMillis, long maxPeers) - Parameters:
myNetworkId
- the network we belong tomyPublicKey
- own public keymySecretKey
- own secret keymyProofOfWork
- own proof of workinitialPingDelayMillis
- time in millis afterInternetDiscoveryChildrenHandler.channelActive(ChannelHandlerContext)
has been fired, we start to ping super peerspingIntervalMillis
- interval in millis between a pingpingTimeoutMillis
- time in millis without ping response before a peer is assumed as unreachablemaxTimeOffsetMillis
- time millis offset of received messages' timestamp before discarding themsuperPeerAddresses
- inet addresses and public keys of super peerspingCommunicationTimeoutMillis
- time in millis a traversed connection to a peer will be discarded without application trafficmaxPeers
- maximum number of peers to which a traversed connection should be maintained at the same time
-
-
Method Details
-
channelRead
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classInternetDiscoveryChildrenHandler
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classInternetDiscoveryChildrenHandler
-
getPrivateAddresses
- Overrides:
getPrivateAddresses
in classInternetDiscoveryChildrenHandler
-