Package org.drasyl.channel
Class ConnectionHandshakeChannelInitializer
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelInitializer<DrasylChannel>
-
- org.drasyl.channel.ConnectionHandshakeChannelInitializer
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
DrasylNodeChannelInitializer
public abstract class ConnectionHandshakeChannelInitializer extends io.netty.channel.ChannelInitializer<DrasylChannel>
-
-
Field Summary
Fields Modifier and Type Field Description static Duration
DEFAULT_HANDSHAKE_TIMEOUT
protected Duration
handshakeTimeout
protected boolean
initiateHandshake
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConnectionHandshakeChannelInitializer(boolean initiateHandshake)
protected
ConnectionHandshakeChannelInitializer(Duration handshakeTimeout, boolean initiateHandshake)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
handshakeCompleted(DrasylChannel ch)
protected abstract void
handshakeFailed(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
protected void
initChannel(DrasylChannel ch)
-
Methods inherited from class io.netty.channel.ChannelInitializer
channelRegistered, exceptionCaught, handlerAdded, handlerRemoved
-
-
-
-
Constructor Detail
-
ConnectionHandshakeChannelInitializer
protected ConnectionHandshakeChannelInitializer(Duration handshakeTimeout, boolean initiateHandshake)
-
ConnectionHandshakeChannelInitializer
protected ConnectionHandshakeChannelInitializer(boolean initiateHandshake)
-
-
Method Detail
-
initChannel
protected void initChannel(DrasylChannel ch) throws Exception
- Specified by:
initChannel
in classio.netty.channel.ChannelInitializer<DrasylChannel>
- Throws:
Exception
-
handshakeCompleted
protected abstract void handshakeCompleted(DrasylChannel ch) throws Exception
- Throws:
Exception
-
handshakeFailed
protected abstract void handshakeFailed(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
-
-