UDP Data Rcvd Acknowledgement

joedarock

Member
Licensed User
Longtime User
I'm building an application that transmits commands to a host which uses UDP communications. I need to send a command to the host, then wait until a reply is received or until a timeout occurs. I'm having great difficulty figuring out how to know if a message was received after I send my command so that I can act on the received data. I'm stuck with UDP on the remote device, so suggestions to use TCP/IP & AsyncStreams would be pointless.

Any help would be appreciated
Joe
 

joedarock

Member
Licensed User
Longtime User
To clarify this a little more...

I "Send" the data request command and then wait for the "Data_Arrived" event to fire. but the event doesn't fire as long as I'm in any type of loop waiting for it. As soon as I break out of the loop and finish the sub containing the "Send", then the event fires. What I want to do is send a command, get the response and process it, then send another command based on the result of the previous response, and so on in a sequenced transaction.
 
Upvote 0

joedarock

Member
Licensed User
Longtime User
Thanks Erel...that's what I thought. It makes things a bit dicey though.

Question: Is this a peculiarity of the UDP Data_Arrived event, or does it apply to other events too? I'm accustomed to VB, where these limitations don't apply, so I'm still trying to get my head around a different paradigm.

Joe
 
Upvote 0

joedarock

Member
Licensed User
Longtime User
Thanks for that; one more question:

If a loop can block the main thread, then what does putting "DoEvents" in a loop actually do?

Joe
 
Upvote 0
Top