Package org.drasyl.channel
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
public class RelayOnlyDrasylServerChannelInitializer
extends io.netty.channel.ChannelInitializer<DrasylServerChannel>
A
ChannelInitializer for DrasylServerChannels that relays all messages through
super peers.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected final InetSocketAddressprotected final Identitystatic final intstatic final intprotected final intprotected final intstatic final intprotected final intstatic final intstatic final intprotected final intprotected final intprotected final booleanstatic final Map<IdentityPublicKey,InetSocketAddress> protected final Map<IdentityPublicKey,InetSocketAddress> -
Constructor Summary
ConstructorsConstructorDescriptionRelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup) Creates a new channel initializer with default values forbindPort,networkId,superPeers,pingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, int bindPort) Creates a new channel initializer with default values fornetworkId,superPeers,pingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress) Creates a new channel initializer with default values fornetworkId,superPeers,pingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey, InetSocketAddress> superPeers) Creates a new channel initializer with default values forpingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey, InetSocketAddress> superPeers, boolean protocolArmEnabled) Creates a new channel initializer with default values forpingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis, andmaxPeers.RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey, InetSocketAddress> superPeers, boolean protocolArmEnabled, int pingIntervalMillis, int pingTimeoutMillis, int maxTimeOffsetMillis, int maxPeers) -
Method Summary
Methods inherited from class io.netty.channel.ChannelInitializer
channelRegistered, exceptionCaught, handlerAdded, handlerRemovedMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
BIND_PORT
public static final int BIND_PORT- See Also:
-
NETWORK_ID
public static final int NETWORK_ID- See Also:
-
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:
-
identity
-
bindAddress
-
networkId
protected final int networkId -
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.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey, InetSocketAddress> superPeers, boolean protocolArmEnabled, int pingIntervalMillis, int pingTimeoutMillis, int maxTimeOffsetMillis, int maxPeers) - Parameters:
identity- own identityudpServerGroup- theNioEventLoopGroupthe underlying udp server should run onbindAddress- address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORTnetworkId- the network we belong to. Default value:NETWORK_IDsuperPeers- list of super peers we register to. Default value:SUPER_PEERSprotocolArmEnabled- iftrueall control plane messages will be encrypted/authenticated. Default value:truepingIntervalMillis- interval in millis between a ping. Default value:PING_INTERVAL_MILLISpingTimeoutMillis- time in millis without ping response before a peer is assumed as unreachable. Default value:PING_TIMEOUT_MILLISmaxTimeOffsetMillis- time millis offset of received messages' timestamp before discarding them. Default value:MAX_TIME_OFFSET_MILLISmaxPeers- 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.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey, InetSocketAddress> superPeers, boolean protocolArmEnabled) Creates a new channel initializer with default values forpingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis, andmaxPeers.- Parameters:
identity- own identityudpServerGroup- theNioEventLoopGroupthe underlying udp server should run onbindAddress- address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORTnetworkId- the network we belong to. Default value:NETWORK_IDsuperPeers- list of super peers we register to. Default value:SUPER_PEERSprotocolArmEnabled- iftrueall control plane messages will be encrypted/authenticated. Default value:true
-
RelayOnlyDrasylServerChannelInitializer
public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress, int networkId, Map<IdentityPublicKey, InetSocketAddress> superPeers) Creates a new channel initializer with default values forpingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.- Parameters:
identity- own identityudpServerGroup- theNioEventLoopGroupthe underlying udp server should run onbindAddress- address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORTnetworkId- the network we belong to. Default value:NETWORK_IDsuperPeers- list of super peers we register to. Default value:SUPER_PEERS
-
RelayOnlyDrasylServerChannelInitializer
public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, InetSocketAddress bindAddress) Creates a new channel initializer with default values fornetworkId,superPeers,pingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.- Parameters:
identity- own identityudpServerGroup- theNioEventLoopGroupthe underlying udp server should run onbindAddress- address the UDP server will bind to. Default value: 0.0.0.0:BIND_PORT
-
RelayOnlyDrasylServerChannelInitializer
public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup, int bindPort) Creates a new channel initializer with default values fornetworkId,superPeers,pingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.- Parameters:
identity- own identityudpServerGroup- theNioEventLoopGroupthe underlying udp server should run onbindPort- port the UDP server will bind to. Default value:BIND_PORT
-
RelayOnlyDrasylServerChannelInitializer
public RelayOnlyDrasylServerChannelInitializer(Identity identity, io.netty.channel.nio.NioEventLoopGroup udpServerGroup) Creates a new channel initializer with default values forbindPort,networkId,superPeers,pingIntervalMillis,pingTimeoutMillis,maxTimeOffsetMillis,maxPeers, and enabled control plane message arming.- Parameters:
identity- own identityudpServerGroup- theNioEventLoopGroupthe underlying udp server should run on
-
-
Method Details
-
initChannel
- Specified by:
initChannelin classio.netty.channel.ChannelInitializer<DrasylServerChannel>
-