Class ClientChannelInitializer
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
org.drasyl.peer.connection.DefaultSessionInitializer
org.drasyl.peer.connection.client.ClientChannelInitializer
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
- Direct Known Subclasses:
DefaultClientChannelInitializer
Creates a newly configured
ChannelPipeline
for a connection to a node server.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
FieldsFields inherited from class org.drasyl.peer.connection.DefaultSessionInitializer
IDLE_EVENT
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ClientChannelInitializer
(int networkId, Identity identity, int flushBufferSize, Duration readIdleTimeout, short pingPongRetries, Endpoint target) Initialize a netty Channel for an outbound connection to a node server. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
beforeMarshalStage
(io.netty.channel.ChannelPipeline pipeline) Methods inherited from class org.drasyl.peer.connection.DefaultSessionInitializer
afterBufferStage, afterExceptionStage, afterFilterStage, afterIdleStage, afterMarshalStage, afterPojoMarshalStage, afterSslStage, beforeBufferStage, beforeExceptionStage, beforeFilterStage, beforeIdleStage, beforePojoMarshalStage, beforeSslStage, bufferStage, customStage, exceptionStage, filterStage, generateSslContext, idleStage, initChannel, marshalStage, pojoMarshalStage, sslStage
Methods inherited from class io.netty.channel.ChannelInitializer
channelRegistered, exceptionCaught, handlerAdded, handlerRemoved
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
target
-
-
Constructor Details
-
ClientChannelInitializer
protected ClientChannelInitializer(int networkId, Identity identity, int flushBufferSize, Duration readIdleTimeout, short pingPongRetries, Endpoint target) Initialize a netty Channel for an outbound connection to a node server.- Parameters:
networkId
- the network the node belongs toidentity
- the node's identityflushBufferSize
- The size of the flush buffer, to minimize IO overhead. A high value is good for throughput. A low value is good for latency.readIdleTimeout
- The maximum time that an active connection can spend in idle before the client checks with a PING request whether the remote station is still alive. Note: every long value <= 0 s deactivates the idle function.pingPongRetries
- The maximum amount that a remote station cannot reply to a PING request in succession in the intervalreadIdleTimeout
. Min value is 1, max 32767target
- the target URI
-
-
Method Details
-
beforeMarshalStage
protected void beforeMarshalStage(io.netty.channel.ChannelPipeline pipeline) - Specified by:
beforeMarshalStage
in classDefaultSessionInitializer
-