method added to make it easier to reply that we have received the ack message
parent
06fa3c2841
commit
f0ab8812a3
|
@ -2,6 +2,7 @@ package earth.krakatao.protocol;
|
||||||
|
|
||||||
import earth.krakatao.Formatter;
|
import earth.krakatao.Formatter;
|
||||||
import earth.krakatao.KraSocketClient;
|
import earth.krakatao.KraSocketClient;
|
||||||
|
import earth.krakatao.SocketClient;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.text.Format;
|
import java.text.Format;
|
||||||
import java.text.Normalizer.Form;
|
import java.text.Normalizer.Form;
|
||||||
|
@ -159,4 +160,18 @@ public class KraSocketClientProtocol {
|
||||||
public void removeMessageFromReceivedQueue(int cmdID) {
|
public void removeMessageFromReceivedQueue(int cmdID) {
|
||||||
this.receivedQueueMessages.remove(cmdID);
|
this.receivedQueueMessages.remove(cmdID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This method is used to send a reply message to the backend that we have received the ack message.
|
||||||
|
public void replyToBackendThatWeReceivedMessage(SocketClient socketClient,
|
||||||
|
KraSocketClientProtocol kraSocketClientProtocol, int cmdID, byte dest, UUID uuid,
|
||||||
|
int cmdNumber) {
|
||||||
|
KraSocketClientProtocolMessage kraSocketClientProtocolMessage = new KraSocketClientProtocolMessage(
|
||||||
|
KraSocketClientProtocolStatus.REPLY.getStatus(), cmdID,
|
||||||
|
KraSocketClientProtocolDest.BACKEND.getStatus(), uuid,
|
||||||
|
cmdNumber, "", null);
|
||||||
|
|
||||||
|
socketClient.SendMessage(kraSocketClientProtocolMessage);
|
||||||
|
|
||||||
|
kraSocketClientProtocol.removeMessageFromReceivedQueue(cmdID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue