Class InternetDiscoverySuperPeerHandler

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
org.drasyl.handler.remote.internet.InternetDiscoverySuperPeerHandler
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler
Direct Known Subclasses:
TraversingInternetDiscoverySuperPeerHandler

public class InternetDiscoverySuperPeerHandler extends io.netty.channel.ChannelDuplexHandler
Operates as a super peer allowing other nodes to join as children. Relays inbound/Route outbound messages to children.
See Also:
  • Field Details

  • Constructor Details

    • InternetDiscoverySuperPeerHandler

      public InternetDiscoverySuperPeerHandler(int myNetworkId, IdentityPublicKey myPublicKey, ProofOfWork myProofOfWork, long pingIntervalMillis, long pingTimeoutMillis, long maxTimeOffsetMillis, HopCount hopLimit)
  • Method Details

    • channelActive

      public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      channelActive in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class io.netty.channel.ChannelInboundHandlerAdapter
    • 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
    • write

      public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise)
      Specified by:
      write in interface io.netty.channel.ChannelOutboundHandler
      Overrides:
      write in class io.netty.channel.ChannelDuplexHandler
    • relayMessage

      protected void relayMessage(io.netty.channel.ChannelHandlerContext ctx, InetAddressedMessage<RemoteMessage> addressedMsg, InetSocketAddress inetAddress)