public class SpinningSocketWriter extends AbstractHandler implements SocketWriter
connection, connectionManager, ioService| Constructor and Description |
|---|
SpinningSocketWriter(TcpIpConnection connection,
MetricsRegistry metricsRegistry,
ILogger logger) |
| Modifier and Type | Method and Description |
|---|---|
long |
bytesPending() |
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 |
offer(OutboundFrame frame)
Offers a Frame to be written to the socket.
|
long |
priorityBytesPending() |
void |
setProtocol(String protocol)
Sets the protocol this SocketWriter should use.
|
void |
shutdown()
Shuts down this SocketWriter.
|
void |
start()
Starts this SocketWriter.
|
int |
totalFramesPending()
Returns the total number of packets (urgent and non normal priority) pending to be written to the socket.
|
void |
write() |
onFailurepublic SpinningSocketWriter(TcpIpConnection connection, MetricsRegistry metricsRegistry, ILogger logger)
public void offer(OutboundFrame frame)
SocketWriteroffer in interface SocketWriterframe - the Frame to write.public long bytesPending()
public long priorityBytesPending()
public int totalFramesPending()
SocketWritertotalFramesPending in interface SocketWriterpublic long getLastWriteTimeMillis()
SocketWriterClock.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.getLastWriteTimeMillis in interface SocketWriterpublic WriteHandler getWriteHandler()
SocketWriterWriteHandler that belongs to this SocketWriter.
This method exists for the TextReadHandler, but probably should be deleted.getWriteHandler in interface SocketWriterpublic void setProtocol(String protocol)
SocketWriterProtocolssetProtocol in interface SocketWriterprotocol - the protocolpublic void start()
SocketWriterstart in interface SocketWriterSocketWriter.shutdown()public void shutdown()
SocketWritershutdown in interface SocketWriterSocketWriter.start()Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.