473,387 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Asynch Threading

With WebServices in 2.0 where the proxy classes is created to allow you to
make a WebMethod call Asynch, when the delegate is called does it execute
on the background thread or the foreground thread? In other words in the
example below, will the wsWebServiceProxy_SendMessageCompleted be executed
on the same thread as the Foo() method?

Is there any need to unhook the EventHandler once the delegate has finished
executed *or* will the gc clean it up *or* does it depend on if the
wsWebServiceProxy's scope (i.e. if it's a local to the Foo() method or
global to the class?

private void Foo()
{
wsWebServiceProxy.SendMessageCompleted += new
SendMessageCompletedEventHandler(wsWebServiceProxy _SendMessageCompleted);
wsWebServiceProxy.SendMessageAsync(oMessage);
}

private void wsWebServiceProxy_SendMessageCompleted(object sender,
SendMessageEventArgs e)
{
//Execute any code after the WebMethod call has completed
//Does code executed here need to be Invoked to execute on the
foreground thread?

//Is this needed or does this depend on the scope of the
wsWebServiceProxy object?
((WebServiceProxy)sender).SendMessageCompleted -= new
SendMessageCompletedEventHandler(wsWebServiceProxy _SendMessageCompleted);
}

TIA
Sep 26 '08 #1
0 801

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cybertof | last post by:
Hello, I'm inserting a new row in a Access database containing an "AutoIncrement" column. The autoincrement value is set by the database once the update occurs. The only way to get this value...
1
by: Michael Evanchik | last post by:
im trying to do a get on a http server and keep appending the return data to a string and then i even tried an array of strings. But very odd things are happening. I am completely missing the...
11
by: Glen Wolinsky | last post by:
This is my first attempt as asynchronous processing. I have created a small test app as proof of concept, but I am having one proglem. In the example (code listed below), my callback routine has...
2
by: ghost | last post by:
As the Subject indicates I have written a web page that makes use of several web service calls. Some of the web service calls are very fast so they called synchronously. Some web service calls...
5
by: Ric | last post by:
I created a page in ASP.Net (with no buffering) that does the following: Output line #1 FLUSH {wait 1 second} Output line #2 {wait 1 second} Output line #3 FLUSH
1
by: David Veeneman | last post by:
Does anyone knmow why an asynchronous worker method would crash if the e.Cancel method is set to true, but not otherwise? I'm working on a demo app with an asynchronous call, using the .NET 2.0...
2
by: Techno_Dex | last post by:
What is the correct way to debug a WS which makes it's call Asynch?
4
by: EM_J | last post by:
I am implementing this interface in one of my pages. The RaiseCallbackEvent method runs a task for about 3 seconds. I've noticed when I am on that page and click a tab to navigate to another...
0
by: Patino | last post by:
I have a particular WS consumer application (Windows app) that was not able to read an error from the WS app because it was calling a method asynch. The client app just hangs there. But once I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.