public final class NioChannel extends AbstractChannel
Channel implementation tailored
for non blocking IO using Selector in combination
with a non blocking SocketChannel.logger, socketChannel| Constructor and Description |
|---|
NioChannel(SocketChannel socketChannel,
boolean clientMode,
ChannelInitializer channelInitializer,
MetricsRegistry metricsRegistry,
Executor closeListenerExecutor) |
| Modifier and Type | Method and Description |
|---|---|
long |
bytesRead()
Returns current count of bytes read from the Channel.
|
long |
bytesWritten()
Returns current count of bytes written into the Channel.
|
protected void |
close0()
Template method that is called when the Channel is closed.
|
NioInboundPipeline |
inboundPipeline()
Returns the
InboundPipeline that belongs to this Channel. |
void |
init(NioInboundPipeline inboundPipeline,
NioOutboundPipeline outboundPipeline) |
long |
lastReadTimeMillis()
Returns the last time epoch time in ms a read of the socket was done.
|
long |
lastWriteTimeMillis()
Returns the last time epoch time in ms a write to the socket was done.
|
protected void |
onConnect()
Template method that can be implemented when the
AbstractChannel.connect(InetSocketAddress, int)
has completed. |
com.hazelcast.internal.networking.nio.NioChannelOptions |
options()
Returns the
ChannelOptions of this Channel. |
NioOutboundPipeline |
outboundPipeline()
Returns the
OutboundPipeline that belongs to this Channel. |
void |
start()
Starts the Channel.
|
String |
toString() |
boolean |
write(OutboundFrame frame)
Queues the
OutboundFrame to be written at some point in the future. |
addCloseListener, attributeMap, close, connect, isClientMode, isClosed, localSocketAddress, notifyCloseListeners, remoteSocketAddress, socket, socketChannelpublic NioChannel(SocketChannel socketChannel, boolean clientMode, ChannelInitializer channelInitializer, MetricsRegistry metricsRegistry, Executor closeListenerExecutor)
public com.hazelcast.internal.networking.nio.NioChannelOptions options()
ChannelChannelOptions of this Channel.
Call is threadsafe; but calls to the ChannelOptions are not.public void init(NioInboundPipeline inboundPipeline, NioOutboundPipeline outboundPipeline)
public NioOutboundPipeline outboundPipeline()
ChannelOutboundPipeline that belongs to this Channel.
This method is threadsafe, but most methods on the OutboundPipeline are not!public NioInboundPipeline inboundPipeline()
ChannelInboundPipeline that belongs to this Channel.
This method is threadsafe, but most methods on the InboundPipeline are not!public boolean write(OutboundFrame frame)
ChannelOutboundFrame to be written at some point in the future.
No guarantee is made that the frame actually is going to be written or received.
This method is thread-safe.frame - the frame to write.protected void onConnect()
AbstractChannelAbstractChannel.connect(InetSocketAddress, int)
has completed.onConnect in class AbstractChannelpublic long lastReadTimeMillis()
Channelpublic long lastWriteTimeMillis()
Channelpublic void start()
ChannelChannel.connect(InetSocketAddress, int)
should be called before start is called.
When the Channel is started, the ChannelInitializer will be called to
initialize the channel and to start with processing inbound and outbound data.
This method is not threadsafe and should be made only once.protected void close0()
AbstractChannelclose0 in class AbstractChannelpublic long bytesRead()
Channelpublic long bytesWritten()
ChannelCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.