public interface SocketWriter
TcpIpConnection
has a SocketWriter
and it writes OutboundFrame
instances to the socket. Copying
the Frame instances to the byte-buffer is done using the WriteHandler
.
Each TcpIpConnection
has its own SocketWriter
instance.
Before Hazelcast 3.6 the name of this interface was WriteHandler.SocketReader
,
ReadHandler
,
IOThreadingModel
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this SocketWriter.
|
long |
getLastWriteTimeMillis()
Returns the last
Clock.currentTimeMillis() that a write to the socket completed. |
WriteHandler |
getWriteHandler()
Gets the
WriteHandler that belongs to this SocketWriter. |
void |
setProtocol(String protocol)
Sets the protocol this SocketWriter should use.
|
int |
totalFramesPending()
Returns the total number of packets (urgent and non normal priority) pending to be written to the socket.
|
void |
write(OutboundFrame frame)
Offers a Frame to be written to the socket.
|
int totalFramesPending()
long getLastWriteTimeMillis()
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.void write(OutboundFrame frame)
frame
- the Frame to write.WriteHandler getWriteHandler()
WriteHandler
that belongs to this SocketWriter.
This method exists for the TextReadHandler
, but probably should be deleted.void setProtocol(String protocol)
Protocols
protocol
- the protocolvoid close()
TcpIpConnection.close(String, Throwable)
method.Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.