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:
  • Field Details

  • Constructor Details

    • InternetDiscoveryChildrenHandler

      public InternetDiscoveryChildrenHandler(LongSupplier currentTime, long initialPingDelayMillis)
    • InternetDiscoveryChildrenHandler

      public InternetDiscoveryChildrenHandler(long initialPingDelayMillis)
    • InternetDiscoveryChildrenHandler

      public InternetDiscoveryChildrenHandler()
  • Method Details

    • handlerAdded

      public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws UnknownHostException
      Specified by:
      handlerAdded in interface io.netty.channel.ChannelHandler
      Overrides:
      handlerAdded in class io.netty.channel.ChannelHandlerAdapter
      Throws:
      UnknownHostException
    • channelActive

      public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws UnknownHostException
      Specified by:
      channelActive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class io.netty.channel.ChannelInboundHandlerAdapter
      Throws:
      UnknownHostException
    • channelInactive

      public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      channelInactive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelInactive in class io.netty.channel.ChannelInboundHandlerAdapter
    • channelRead

      public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Specified by:
      channelRead in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
    • userEventTriggered

      public void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)
      Specified by:
      userEventTriggered in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      userEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapter
    • getPrivateAddresses

      protected Set<InetSocketAddress> getPrivateAddresses()
    • writeHelloMessage

      protected void writeHelloMessage(io.netty.channel.ChannelHandlerContext ctx, DrasylAddress publicKey, InetSocketAddress inetAddress, Set<InetSocketAddress> privateInetAddresses)
      Make sure to call Channel.flush() by your own!
    • isUnexpectedMessage

      protected boolean isUnexpectedMessage(Object msg)
    • config

      protected static DrasylServerChannelConfig config(io.netty.channel.ChannelHandlerContext ctx)