ScottFoster1000
ScottFoster1000

Reputation: 617

How to use HubConnectionBuilder to communicate with javascript clients once the HubConnection is disposed

I'm trying to use the BubConnectionBuilder with my SignalR implementation in order to recreate a hub instance from a background service on the server to contact a client once a process is completed at the server.

Since the HubConnection is short lived, my Hub Clients is disposed when I try to go back and communicate with the client, so I'm trying to use the HubConnectionBuilder to re-create a hub to send the message (I retain the connection id with the task)

The .Net client documentation states that you use .WithUrl('') to specify the hub url, but the SignalR .Net Core client library off nuget doesn't have that, it only has a services collection. Is there any documentation or examples of the nuget package in use?

Upvotes: 1

Views: 13361

Answers (1)

Brennan
Brennan

Reputation: 1933

The documentation is at https://learn.microsoft.com/en-us/aspnet/core/signalr/dotnet-client?view=aspnetcore-2.2

The reason you don't see WithUrl(...) is because you're using the Microsoft.AspNetCore.SignalR.Client.Core NuGet package, you should be using Microsoft.AspNetCore.SignalR.Client instead.

Upvotes: 4

Related Questions