Hi!
For MS4 our handler uses reply messages to control the amount of redundancy. After sending a certain number of messages our handler adds a XOR message. If the handler on the receiver side notices packet loss it informs the handler on the sender side to increase the amount of redundancy by sending a reply message:
Code: Alles auswählen
TypedMap ctrl = new TypedMap();
ctrl.putString("request", "control");
ctrl.putString("mode", "set");
ctrl.putInt("adjustment", i);
Message ctrlMsg = new Message();
putHeader(ctrlMsg, "fec", ctrl);
ctrlMsg.setType(mimeType);
sendReply(msg, ctrlMsg);
resetReceiver(i);
The problem is, that if our TestSender-Application send it's messages to fast, our handler does not receive these control messages in time:
Code: Alles auswählen
for (int i=1; i<=NUM_MESSAGES; i++)
{
TypedMap map = new TypedMap();
map.putInt("seq", i);
Message msg = new Message(map);
if (payload!=null)
msg.put("payload", "bin", payload);
publisher.send(msg);
numMsgSent++;
Thread.sleep(1);
}
If we increase the time between 2 messages from Thread.sleep(1) to Thread.sleep(100) everything seems to work.
Is there a way to make the handler wait for a control message before sending further messages?