public class SpinningChannel extends AbstractChannel
socketChannel
Constructor and Description |
---|
SpinningChannel(SocketChannel socketChannel,
boolean clientMode) |
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flushes whatever needs to be written.
|
SpinningChannelReader |
getReader() |
SpinningChannelWriter |
getWriter() |
long |
lastReadTimeMillis()
Returns the last
Clock.currentTimeMillis() a read of the socket was done. |
long |
lastWriteTimeMillis()
Returns the last
Clock.currentTimeMillis() that a write to the socket completed. |
void |
setReader(SpinningChannelReader reader) |
void |
setWriter(SpinningChannelWriter writer) |
String |
toString() |
boolean |
write(OutboundFrame frame)
Queues the
OutboundFrame to be written at some point in the future. |
addCloseListener, attributeMap, close, closeInbound, closeOutbound, getLocalSocketAddress, getRemoteSocketAddress, isClientMode, isClosed, onClose, read, socket, socketChannel, write
public SpinningChannel(SocketChannel socketChannel, boolean clientMode)
public void setReader(SpinningChannelReader reader)
public void setWriter(SpinningChannelWriter writer)
public SpinningChannelReader getReader()
public SpinningChannelWriter getWriter()
public boolean write(OutboundFrame frame)
Channel
OutboundFrame
to be written at some point in the future. No guarantee is made that the
frame actually is going to be written or received.frame
- the frame to write.public void flush()
Channel
Channel.write(OutboundFrame)
write the content; but in case of protocol
and TLS handshaking, such triggers are needed.public long lastReadTimeMillis()
Channel
Clock.currentTimeMillis()
a read of the socket was done.public long lastWriteTimeMillis()
Channel
Clock.currentTimeMillis()
that a write to the socket completed.
Writing to the socket doesn't mean that data has been send or received; it means that data was written to the
SocketChannel. It could very well be that this data is stuck somewhere in an io-buffer.Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.