C
Cheryl
I have an application that is asynchronous in design. For example.
obj.SendCommand(string cmd)
and the result will be returned in a callback function.
public void obj_OnCommandFinished(object sender, string result)
Will that be possible to turn combine these two functions so that i can get
the result through synchronous calls?
result = SendCommand(string cmd)
If yes, how should I implement that? My current design is to use a flag to
determine whether the results has returned or not. However, i have to poll
this flag and sleep the thread in order to wait for the result.
Any suggestions?
Thanks!
obj.SendCommand(string cmd)
and the result will be returned in a callback function.
public void obj_OnCommandFinished(object sender, string result)
Will that be possible to turn combine these two functions so that i can get
the result through synchronous calls?
result = SendCommand(string cmd)
If yes, how should I implement that? My current design is to use a flag to
determine whether the results has returned or not. However, i have to poll
this flag and sleep the thread in order to wait for the result.
Any suggestions?
Thanks!