Class RelayOnlyDrasylServerChannelInitializer

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelInitializer<DrasylServerChannel>
org.drasyl.channel.RelayOnlyDrasylServerChannelInitializer
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler
Direct Known Subclasses:
TraversingDrasylServerChannelInitializer

@UnstableApi public class RelayOnlyDrasylServerChannelInitializer extends io.netty.channel.ChannelInitializer<DrasylServerChannel>
A ChannelInitializer for DrasylServerChannels that relays all messages through super peers.
  • Field Details

    • BIND_PORT

      public static final int BIND_PORT
      See Also:
    • NETWORK_ID

      public static final int NETWORK_ID
      See Also:
    • SUPER_PEERS

      public static final Map<IdentityPublicKey,InetSocketAddress> SUPER_PEERS
    • PING_INTERVAL_MILLIS

      public static final int PING_INTERVAL_MILLIS
      See Also:
    • PING_TIMEOUT_MILLIS

      public static final int PING_TIMEOUT_MILLIS
      See Also:
    • MAX_TIME_OFFSET_MILLIS

      public static final int MAX_TIME_OFFSET_MILLIS
      See Also:
    • MAX_PEERS

      public static final int MAX_PEERS
      See Also:
    • UNARMED_MESSAGE_DECODER

      protected static final UnarmedMessageDecoder UNARMED_MESSAGE_DECODER
    • LOOPBACK_HANDLER

      protected static final LoopbackHandler LOOPBACK_HANDLER
    • identity

      protected final Identity identity
    • bindAddress

      protected final InetSocketAddress bindAddress
    • networkId

      protected final int networkId
    • superPeers

      protected final Map<IdentityPublicKey,InetSocketAddress> superPeers
    • protocolArmEnabled

      protected final boolean protocolArmEnabled
    • pingIntervalMillis

      protected final int pingIntervalMillis
    • pingTimeoutMillis

      protected final int pingTimeoutMillis
    • maxTimeOffsetMillis

      protected final int maxTimeOffsetMillis
    • maxPeers

      protected final int maxPeers
  • Constructor Details

    • RelayOnlyDrasylServerChannelInitializer

      public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.EventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey,InetSocketAddress> superPeers, boolean protocolArmEnabled, int pingIntervalMillis, int pingTimeoutMillis, int maxTimeOffsetMillis, int maxPeers)
      Parameters:
      identity - own identity
      udpServerGroup - the NioEventLoopGroup the underlying udp server should run on
      bindAddress - address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORT
      networkId - the network we belong to. Default value: NETWORK_ID
      superPeers - list of super peers we register to. Default value: SUPER_PEERS
      protocolArmEnabled - if true all control plane messages will be encrypted/authenticated. Default value: true
      pingIntervalMillis - interval in millis between a ping. Default value: PING_INTERVAL_MILLIS
      pingTimeoutMillis - time in millis without ping response before a peer is assumed as unreachable. Default value: PING_TIMEOUT_MILLIS
      maxTimeOffsetMillis - time millis offset of received messages' timestamp before discarding them. Default value: MAX_TIME_OFFSET_MILLIS
      maxPeers - maximum number of peers to which a traversed connection should be maintained at the same time. Default value: MAX_PEERS
    • RelayOnlyDrasylServerChannelInitializer

      public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.EventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey,InetSocketAddress> superPeers, boolean protocolArmEnabled)
      Creates a new channel initializer with default values for pingIntervalMillis, pingTimeoutMillis, maxTimeOffsetMillis, and maxPeers.
      Parameters:
      identity - own identity
      udpServerGroup - the NioEventLoopGroup the underlying udp server should run on
      bindAddress - address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORT
      networkId - the network we belong to. Default value: NETWORK_ID
      superPeers - list of super peers we register to. Default value: SUPER_PEERS
      protocolArmEnabled - if true all control plane messages will be encrypted/authenticated. Default value: true
    • RelayOnlyDrasylServerChannelInitializer

      public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.EventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey,InetSocketAddress> superPeers)
      Creates a new channel initializer with default values for pingIntervalMillis, pingTimeoutMillis, maxTimeOffsetMillis, maxPeers, and enabled control plane message arming.
      Parameters:
      identity - own identity
      udpServerGroup - the NioEventLoopGroup the underlying udp server should run on
      bindAddress - address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORT
      networkId - the network we belong to. Default value: NETWORK_ID
      superPeers - list of super peers we register to. Default value: SUPER_PEERS
    • RelayOnlyDrasylServerChannelInitializer

      public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.EventLoopGroup udpServerGroup, InetSocketAddress bindAddress)
      Creates a new channel initializer with default values for networkId, superPeers, pingIntervalMillis, pingTimeoutMillis, maxTimeOffsetMillis, maxPeers, and enabled control plane message arming.
      Parameters:
      identity - own identity
      udpServerGroup - the NioEventLoopGroup the underlying udp server should run on
      bindAddress - address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORT
    • RelayOnlyDrasylServerChannelInitializer

      public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.EventLoopGroup udpServerGroup, int bindPort)
      Creates a new channel initializer with default values for networkId, superPeers, pingIntervalMillis, pingTimeoutMillis, maxTimeOffsetMillis, maxPeers, and enabled control plane message arming.
      Parameters:
      identity - own identity
      udpServerGroup - the NioEventLoopGroup the underlying udp server should run on
      bindPort - port the UDP server will bind to. Default value: BIND_PORT
    • RelayOnlyDrasylServerChannelInitializer

      public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.EventLoopGroup udpServerGroup)
      Creates a new channel initializer with default values for bindPort, networkId, superPeers, pingIntervalMillis, pingTimeoutMillis, maxTimeOffsetMillis, maxPeers, and enabled control plane message arming.
      Parameters:
      identity - own identity
      udpServerGroup - the NioEventLoopGroup the underlying udp server should run on
  • Method Details