soernt / signalr_client

A Flutter SignalR Client for ASP.NET Core
MIT License
129 stars 202 forks source link

Not able to specify Hub in server. #21

Closed ghost closed 4 years ago

ghost commented 5 years ago

For example in one of our API's we have multiple signalR hubs such as UserHub, DataHub, and Message Hub. In C# we would do something like:

var signalRConnection = new HubConnection("http://{serverUrl}"); var signalRUserProxy = signalRConnection.CreateHubProxy("UserHub"); var signalRDataProxy = signalRConnection.CreateHubProxy("DataHub"); var signalRMessageProxy = signalRConnection.CreateHubProxy("MessageHub"); signalRConnection.Start().Wait(); signalRUserProxy.On("updateUsers", x => UpdateUsers(x)); signalRDataProxy.On("updateData", x => UpdateData(x)); signalRMessageProxy.On("updateMessages", x => UpdateMessages(x));

Where each proxy represents a different Hub. I don't see how to accomplish this with the example code supplied.

soernt commented 5 years ago

That is not possible anymore with ASP.Net Core. You need to have a dedicated connection foreach hub.