Thomas
Thomas

Reputation: 2615

Async calls from methods already running in threadpool

I am sorry for the title but I really do not know how to better describe it. I am using threadpool for processing incoming data on the server side and in one method I would need to call static method asynchronously but I am not sure how to do that.

When server receives the data from client, it uses threadpool:

System.Threading.ThreadPool.QueueUserWorkItem(c.ReadData);

In the c.ReadData I would need to call static method which result is not important (sends some data to website) and I dont need to know it. I am just not sure what is the best solution here. Thank you!

Upvotes: 0

Views: 205

Answers (1)

pmarflee
pmarflee

Reputation: 3428

You can use the HttpWebRequest class to programmatially make a request to a resource via HTTP. Put a call to this method in your method that you're passing into QueueUserWorkItem.

Upvotes: 2

Related Questions