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
public abstract class ClientChannelInitializer extends DefaultSessionInitializer
Creates a newly configuredChannelPipeline
for a connection to a node server.
-
-
Field Summary
Fields Modifier and Type Field Description protected Endpoint
target
-
Fields inherited from class org.drasyl.peer.connection.DefaultSessionInitializer
IDLE_EVENT
-
-
Constructor Summary
Constructors Modifier Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
-
-
-
-
Field Detail
-
target
protected final Endpoint target
-
-
Constructor Detail
-
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 Detail
-
beforeMarshalStage
protected void beforeMarshalStage(io.netty.channel.ChannelPipeline pipeline)
- Specified by:
beforeMarshalStage
in classDefaultSessionInitializer
-
-