• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

.net application problem

Deeko

Lifer
Ok, here's my situation...

I have a .NET/C# application that acts as a "middleman" between a flash user interface and a hardware device. The flash communicates with .NET using the external API(the old version uses FS commands but I get the same result either way), and the device communicates through serial.

At the end of a transaction, the flash requests the transaction to end. I send this command to the device, it clears out its message queue and eventually(takes less than a second but there is a delay) reports back to me a value. The flash requests this value from me...problem is, the flash can request this at any time after 'end transaction' is pressed, and sometimes the device hasn't communicated it back to the app yet. How can I make the application wait until its ready? I can't tell the flash to ask again...it will ask once, and expect a value to be returned. I somehow need a way for it to just wait until the device returns the value, and then return it to the flash.

I've tried using Thread.Sleep, and a timer, neither worked because that pauses the entire application, not just that specific function...

Any ideas?
 
Seems like a pretty straightforward example of asynchronous threading. There are numerous ways to do this. One would be to pass a delegate from the client app, then on the server app invoke the delegate when the result is ready. The client app can continue doing whatever in the meantime.
 
Is there a reason you couldn't pass a token back to the flash application that it can use to query the results? If the results aren't ready, you return that to the flash application which will have the same token to re-request the results. This is the typical approach you choose when you can't create a callback.
 
Back
Top