Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to update my clients using Centralized signal-R hub


* I have hosted stand alone Signal-R hub

* I have stand alone schedule Task Service

* I have TEST Application

* I have Development Application


when ever schedule Task Service runs if any of the data failed to updated in DB i have to catch those data from service and send the notification regarding the failure details,i like to send those notification through the Centralized Signal-R hub

so the notification should update Test Application Clients or Dev Application Clients based on my configuration


WCF -----(Failure Data, Application Name(DEV orTest ))---->Signal-R HUB ------->Dev Site Clients or TEST Site Clients


i have to configure my application Name in configuration part so based on the configuration it should update the clients

is it possible ? give some sample code for this

What I have tried:

I have created signal hub i can access from clients but i have to done it from WCF Service
Posted
Updated 30-Mar-16 4:26am

1 solution

C#
public class Service1 : IService1
 {
    

     private readonly IHubProxy messageHub;

     public Service1()
     {
         try
         {   // Create Connection To Signal-R Hub
             var connection = new HubConnection("<<Signal-R Hosted URL>>");
             messageHub = connection.CreateHubProxy("<<HUB NAME>>");
             connection.Start().Wait();
         }
         catch(Exception ex)
         {

         }

     }

     public void SendMessage()
     {
         //Calling particular methode in Signa-R Hub
         messageHub.Invoke("<<SignalR Methode>>", "<<Param1>>", "<<Param2>>");
     }
 }


* Replace your data in <<>>
* it ll automatically update your clients which is referred by the above signal r hub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900