Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Push notification is supported in Silverlight 2 using the new WCF PollingDuplexHttpBinding support. There are two assemblies installed with the Silverlight SDK (<a href="http://petermcg.wordpress.com/2008/09/03/silverlight-polling-duplex-part-1-architecture/" rel="noreferrer">one for Silverlight app one for WCF server</a>).</p> <p>I have a <a href="http://petermcg.wordpress.com/2008/11/19/silverlight-polling-duplex-part-4-wpf-client/" rel="noreferrer">few blog posts and a full sample application</a> that demonstrate how to 'push' Stock updates from a Console Application server that self-hosts a WCF service to connected clients. It also shows how each client can add notes against a Stock and have those notes synchronized (pushed from server) to all other connected clients.</p> <p>The latest version of the sample (Part 4) shows how to synchronize pushed updates between both Silverlight and WPF clients using two server endpoints as follows:</p> <pre><code>using System; using System.ServiceModel; using System.ServiceModel.Description; namespace StockServer { public class StockServiceHost : ServiceHost { public StockServiceHost(object singletonInstance, params Uri[] baseAddresses) : base(singletonInstance, baseAddresses) { } public StockServiceHost(Type serviceType, params Uri[] baseAddresses) : base(serviceType, baseAddresses) { } protected override void InitializeRuntime() { this.AddServiceEndpoint( typeof(IPolicyProvider), new WebHttpBinding(), new Uri("http://localhost:10201/")).Behaviors.Add(new WebHttpBehavior()); this.AddServiceEndpoint( typeof(IStockService), new PollingDuplexHttpBinding(), new Uri("http://localhost:10201/SilverlightStockService")); this.AddServiceEndpoint( typeof(IStockService), new WSDualHttpBinding(WSDualHttpSecurityMode.None), new Uri("http://localhost:10201/WpfStockService")); base.InitializeRuntime(); } } } </code></pre> <p>WPF clients connect to the WSDualHttpBinding endpoint and Silverlight clients connect to the PollingDuplexHttpBinding endpoint of the same WCF service. The app also shows how to handle the Silverlight client access policy requirements.</p> <p>Clients (Silverlight or WPF) can add notes against a Stock in their UI and these notes propagate back to the server to be pushed to all other clients. This demonstrates communication in either direction and hopefully performs all of the necessary communication required for your app.</p> <p>You can see a screenshot of the <a href="http://petermcg.wordpress.com/2008/11/19/silverlight-polling-duplex-part-4-wpf-client/" rel="noreferrer">demo application running here</a>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload