Solved

WCF Multithreading

Posted on 2011-03-04
3
781 Views
Last Modified: 2013-12-17
I am developing an application with one server and several clients connected through WCF.

The server app keeps a collection of all transaction objects (which stores the start time, end time, type of transaction, etc). The client apps are used for monitoring the transactions remotely.

When a client app first connects to the server app, the server app would send the whole collection to the client. How can I do that on a separate thread? Since I will be sending the whole collection, then I will need to lock it, thus preventing my main thread from modifying the collection making it work on a separate thread pointless.
0
Comment
Question by:Thomasian
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 35036099
You could make a copy - which should be rapid (?) - then send the copy via another thread for the slower transmission.
0
 
LVL 22

Author Comment

by:Thomasian
ID: 35036680
How do I send the changes to the collections then? When transaction are added/modified also need to update the client. But since it could only be sending one transaction for the update, is it possible that the client receives the update first before the collection?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35037343
1) How do I send the changes to the collections then?
2) When transaction are added/modified also need to update the client.
3) But since it could only be sending one transaction for the update, is it possible that the client receives the update first before the collection?


1) I don't know how you could 'push' from server to client.  However your client could easily have a timer loop that checks the server for some ID of the latest update and 'pulls' via the same mechanism as the initial update (changes since ID zero for instance)

2) see 1)

3) Only if the client uses multiple threads to get data from the server.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP.net pdf file opening in debug mode but not on web 13 26
Tabcontrol Caption? 1 24
Exception in Log4Net 1 20
Code enhancement 5 13
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now