Link to home
Start Free TrialLog in
Avatar of Thomasian
ThomasianFlag for Philippines

asked on

WCF Multithreading

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.
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Thomasian

ASKER

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?
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.