I have to design a application (client/server) where server will be sending the data to all the connected client(clients will be connected to server either by TCP/IP or Remoting). The problem here is server has to retrieve the data from the data base and
the data will be changing after every 5 seconds in the database. My questions here is ...
What will be the best approach to establish the connection between client and server i.e: TCP/IP(socket programing) or by using Remoting
How to deal with the database where the data will be changing after each 5 seconds
What is the best why to send the data to all the clients(i.e: convert the database data into xml file or convert the database data into an object )before pushing the data to the clients
The article shows how to do it using duplex contracts, but you can achieve it using tcp/ip sockets too, among others. Have a look at
http://msdn.microsoft.com/en-us/library/ms978603.aspx to know about the publisher - subscriber pattern in general.
If a .NET solution will suffice, then you could use a net.tcp WCF service to have Silverlight clients subscribe to updates being pushed. Have a look at the following for some full examples on doing this:
getchinna_sv
Star
12043 Points
2096 Posts
How to desing this
Mar 09, 2012 05:57 AM|LINK
I have to design a application (client/server) where server will be sending the data to all the connected client(clients will be connected to server either by TCP/IP or Remoting). The problem here is server has to retrieve the data from the data base and the data will be changing after every 5 seconds in the database. My questions here is ...
Brutus Maxim...
Member
68 Points
15 Posts
Re: How to desing this
Mar 09, 2012 06:18 AM|LINK
How is the data changing? Is the same data being modified/updated or is new data being added/deleted?
Brutus
getchinna_sv
Star
12043 Points
2096 Posts
Re: How to desing this
Mar 09, 2012 06:57 AM|LINK
data can be updated or added ...
Brutus Maxim...
Member
68 Points
15 Posts
Re: How to desing this
Mar 09, 2012 07:28 AM|LINK
I don't entirely get your scenario , but I am wondering if you could benefit by implementing some sort of publisher - subscriber pattern. You can see one implementation here at http://nagavitalp.blogspot.in/2011/03/implement-publisher-subscriber-model-in.html
The article shows how to do it using duplex contracts, but you can achieve it using tcp/ip sockets too, among others. Have a look at http://msdn.microsoft.com/en-us/library/ms978603.aspx to know about the publisher - subscriber pattern in general.
Hope this helps.
Brutus
XIII
All-Star
182708 Points
23464 Posts
ASPInsiders
Moderator
MVP
Re: How to desing this
Mar 09, 2012 09:29 AM|LINK
Hi,
make use of the Hub approach in SignalR.
Grz, Kris.
Interested in Azure, ASP.NET (MVC), jQuery, WCF, EF, MS SQL, ...
Keep the forums clean: report to the moderation team!
atconway
All-Star
16846 Points
2756 Posts
Re: How to desing this
Mar 09, 2012 08:25 PM|LINK
If a .NET solution will suffice, then you could use a net.tcp WCF service to have Silverlight clients subscribe to updates being pushed. Have a look at the following for some full examples on doing this:
Pushing Data to a Silverlight Client with a WCF Duplex Service:
http://weblogs.asp.net/dwahlin/archive/2008/06/16/pushing-data-to-a-silverlight-client-with-wcf-duplex-service-part-i.aspx
Building and Accessing Duplex Services:
http://msdn.microsoft.com/en-us/library/cc645026(v=VS.95).aspx
I have seen this in action and it works well vs. brute force polling or something similar.