![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Async WCF and InvokeRequired All, I have a smart client that talks to an WCF service, all my calls are ASYNC, I have noticed that InvokeRequired never gets sent to true. When I look at the threads in the debugger, I can see that the async call backs use the same thread as the form, is this always going to be the case? Steve |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Async WCF and InvokeRequired Steve, Can you be a bit more specific on the scenario? Thanks, Juval Lowy. "Steve Drake" <Steve@_NOSPAM_Drakey.co.uk> wrote in message news:eca1R9TFGHA.1676@TK2MSFTNGP09.phx.gbl... > All, > > I have a smart client that talks to an WCF service, all my calls are > ASYNC, I have noticed that InvokeRequired never gets sent to true. > > When I look at the threads in the debugger, I can see that the async call > backs use the same thread as the form, is this always going to be the > case? > > Steve > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Async WCF and InvokeRequired This is not an issue eg is not causing me a problem. I have a windows form application, I run a remote method asynchronously, eg thing.BeginGetNodes(treeParent, new AsyncCallback(endAddNodes), new statething(tn, treeParent)); In my endAddNodes I would expect me to need to todo code like : if (InvokeRequired) { // Never gets called this.BeginInvoke(new AsyncCallback(endAddNodes), new object[] { ar }); } but, as InvokeRequired never gets set to true, i dont need this code, i have check the Thread number in Debug, and the endAddNodes is getting called by the correct thread, eg is the thread that is used to create the form. So, my question is, is this by design and is it going to remain. Steve "Juval Lowy" <juval.lowy_remove_this@idesign.net> wrote in message news:OP3qTOXFGHA.524@TK2MSFTNGP09.phx.gbl... > Steve, > > Can you be a bit more specific on the scenario? > > Thanks, > > Juval Lowy. > > > "Steve Drake" <Steve@_NOSPAM_Drakey.co.uk> wrote in message > news:eca1R9TFGHA.1676@TK2MSFTNGP09.phx.gbl... >> All, >> >> I have a smart client that talks to an WCF service, all my calls are >> ASYNC, I have noticed that InvokeRequired never gets sent to true. >> >> When I look at the threads in the debugger, I can see that the async call >> backs use the same thread as the form, is this always going to be the >> case? >> >> Steve >> > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: Async WCF and InvokeRequired I assume you are using a proxy with [OperationContract(AsyncPattern = true,.] Yes, this is by design. If Begin<operation name> is dispatched by a UI thread (actually, any thread that has Windows Forms context), the callback will automatically be marshaled to UI thread so that you could access windows and controls directly. A similar feature is available with ASMX proxies in .NET 2.0 without WCF, as well as PictureBox.LoadAsync(), SoundPlayer, Ping.Send(), etc. Hope that helps, Juval Lowy. "Steve Drake" <Steve@_NOSPAM_Drakey.co.uk> wrote in message news:eggCA7fFGHA.648@TK2MSFTNGP14.phx.gbl... > This is not an issue eg is not causing me a problem. > > I have a windows form application, I run a remote method asynchronously, > eg > > thing.BeginGetNodes(treeParent, new AsyncCallback(endAddNodes), new > statething(tn, treeParent)); > > In my endAddNodes I would expect me to need to todo code like : > > if (InvokeRequired) > { > // Never gets called > this.BeginInvoke(new AsyncCallback(endAddNodes), new object[] { ar }); > } > > but, as InvokeRequired never gets set to true, i dont need this code, i > have check the Thread number in Debug, and the endAddNodes is getting > called by the correct thread, eg is the thread that is used to create the > form. > > So, my question is, is this by design and is it going to remain. > > Steve > > > > > > "Juval Lowy" <juval.lowy_remove_this@idesign.net> wrote in message > news:OP3qTOXFGHA.524@TK2MSFTNGP09.phx.gbl... >> Steve, >> >> Can you be a bit more specific on the scenario? >> >> Thanks, >> >> Juval Lowy. >> >> >> "Steve Drake" <Steve@_NOSPAM_Drakey.co.uk> wrote in message >> news:eca1R9TFGHA.1676@TK2MSFTNGP09.phx.gbl... >>> All, >>> >>> I have a smart client that talks to an WCF service, all my calls are >>> ASYNC, I have noticed that InvokeRequired never gets sent to true. >>> >>> When I look at the threads in the debugger, I can see that the async >>> call backs use the same thread as the form, is this always going to be >>> the case? >>> >>> Steve >>> >> >> > > |
My System Specs![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Design for async call | Fred | .NET General | 0 | 06-10-2008 03:56 AM |
| is it possible to create async processes? | Frank | PowerShell | 5 | 04-16-2007 07:47 AM |