![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | 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) |
| | 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) |
| | 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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| RAS ASYNC Adapter? | Network & Sharing | |||
| Design for async call | .NET General | |||
| is it possible to create async processes? | PowerShell | |||