Tuesday, September 06, 2011 5:21 PM
In diagnosing this problem in a real app, I was able to recreate it using the HelloWorldR2 console sample project, which is working perfectly.
I basically added a new WPF project to the HelloWorldR2 solution, added a single button to the main form, and copy-pasted the code from the main method of the HelloWorldR2 console app sample. When I run this app and click the button, the cluster gets the job and runs it, but the client never receives any responses, and just sits there, blocked at the GetResponses call.
What could be going on here? Can anyone else confirm this behaviour?
Tuesday, September 06, 2011 5:39 PM
Same thing with a WinForms app.
If I run the service call/response gather on a thread pool thread it works as expected. I guess you can't run BrokerClient on a UI thread?
Wednesday, September 07, 2011 3:13 AM
You cannot call GetResponses from UI thread. There're two ways you can do:
1. use response handler instead
2. call getresponse from other thread than main GUI thread.
- Marked As Answer by wbradney Wednesday, September 07, 2011 3:40 PM
Wednesday, September 07, 2011 3:53 PMThanks for the confirmation. In that case it might be nice in a future release to find a way to have GetResponses immediately throw if it detects this condition, rather than wait forever.
- Edited by wbradney Wednesday, September 07, 2011 3:55 PM