Andy May
Andy May

Reputation: 4070

SignalR send message to Clients from external application

Is it possible to send a message to the clients connected to a Hub from another process? I set up LINQPad to reference my Hub project's DLL and set VS to attach debugging to the LINQPad process. My project has a HubNotification class that uses the following code:

dynamic clients = Hub.GetClients<MyHubClass>();
clients.SendMessage("My Message");

When debugging I can see this code being called, but my connected clients never get sent a message. I have verified with Fiddler that there is nothing HTTP happening when the above code runs. Am I missing something or is this just not possible?

Upvotes: 4

Views: 4052

Answers (1)

davidfowl
davidfowl

Reputation: 38764

That call only works if you're in the same app domain. If you want to connect to the signalr service from another process/application, then you need to use a signalr client. More info here:

https://github.com/SignalR/SignalR/wiki/SignalR-Client-Hubs

Upvotes: 5

Related Questions