Hi,
I am using a UDP socket and I am sending a message to a device and then it will then reply.
Sometimes I get the reply and sometimes I don't.
I can only use UDP for the communication.
I have been trying to work out how to use a timer or something like a timer to re-send the same command if I don't get a reply within 2 seconds, but if I do get a reply I don't want to send that command again.
Anyone have any ideas on how I can create a timer or something simlar to send the command again if I don't get a reply, but if I do get a reply not to send the command again ?
(I know how to use timers, but can't work out how to not send the command again if I get the reply)
For Example:
I send 'ABC' UDP message to device.
The device will then reply with a message by UDP.
If I don't get a reply in 2 seconds time, resend 'ABC' again. But if I do get a reply don't send 'ABC' again.
I am using a UDP socket and I am sending a message to a device and then it will then reply.
Sometimes I get the reply and sometimes I don't.
I can only use UDP for the communication.
I have been trying to work out how to use a timer or something like a timer to re-send the same command if I don't get a reply within 2 seconds, but if I do get a reply I don't want to send that command again.
Anyone have any ideas on how I can create a timer or something simlar to send the command again if I don't get a reply, but if I do get a reply not to send the command again ?
(I know how to use timers, but can't work out how to not send the command again if I get the reply)
For Example:
I send 'ABC' UDP message to device.
The device will then reply with a message by UDP.
If I don't get a reply in 2 seconds time, resend 'ABC' again. But if I do get a reply don't send 'ABC' again.