MessageSender which tracks the last time a packet was sent.
| Modifier and Type | Field and Description |
|---|---|
| private long | |
| private MessageSender | |
| private long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public long | getLastPacketSentTime()
Overrides default com. Returns the send time of a very recent packet. |
| public long | getPreviousPacketSentTime()
Overrides default com. Returns the send time of a previous packet. |
| public void | send(byte[]
byte array containing a message packet, int length of the message packetLen, byte message sequence index (used in a native protocol) packetSequence)Overrides default com. Synchronously send the message to server. |
| public MessageSender | undecorate()
Overrides default com. Return the previous PacketSender instance from the decorators chain or the current PacketSender if it is the first entry in a chain. |
| public MessageSender | undecorateAll()
Overrides default com. Return a PacketSender instance free of decorators. |
| lastPacketSentTime | back to summary |
|---|---|
| private long lastPacketSentTime | |
| packetSender | back to summary |
|---|---|
| private MessageSender<NativePacketPayload> packetSender | |
| previousPacketSentTime | back to summary |
|---|---|
| private long previousPacketSentTime | |
| TimeTrackingPacketSender | back to summary |
|---|---|
| public TimeTrackingPacketSender(MessageSender<NativePacketPayload> packetSender) | |
| getLastPacketSentTime | back to summary |
|---|---|
| public long getLastPacketSentTime() Overrides default com. Doc from com. Returns the send time of a very recent packet. Should be used in exception generation when the send operation failed.
| |
| getPreviousPacketSentTime | back to summary |
|---|---|
| public long getPreviousPacketSentTime() Overrides default com. Doc from com. Returns the send time of a previous packet. Should be used in exception generation when the send operation was successful but the following read operation failed.
| |
| send | back to summary |
|---|---|
| public void send(byte[] packet, int packetLen, byte packetSequence) throws IOException Overrides default com. Doc from com. Synchronously send the message to server.
| |
| undecorate | back to summary |
|---|---|
| public MessageSender Overrides default com. Doc from com. Return the previous PacketSender instance from the decorators chain or the current PacketSender if it is the first entry in a chain.
| |
| undecorateAll | back to summary |
|---|---|
| public MessageSender Overrides default com. Doc from com. Return a PacketSender instance free of decorators.
| |